Apply black reformatting to Python files only in regions changed since a given commit. For a practical usage example, see the blog post at https://dev.to/akaihola/improving-python-code-incrementally-3f7a
OTHER License
Published by akaihola almost 4 years ago
README
RevisionRange
class and Git repository test fixture improvements in preparation for a larger refactoring coming in #80README
and clarify that path argument can also be a directoryPublished by akaihola about 4 years ago
pyproject.toml
.-r
/--revision
. Useful for comparing to the best common ancestor, e.g. master...
.Published by akaihola about 4 years ago
This version makes Darker usable for checking feature branches in a CI system.
-L
/--lint
option for running a linter for modified lines.--check
returns 1
from the process but leaves files untouched if any file would require reformatting-r <rev>
/ --revision <rev>
can be used to specify the Git revision to compare against when finding out modified lines. Defaults to HEAD
as before.--no-skip-string-normalization
flag to override skip_string_normalization = true
from a configuration file--diff
option will highlight syntax on screen if the pygments package is available.--diff
are now relative to current working directory, similar to output from black --diff
, and blank lines after the lines markers (@@ ... @@
) have been removed.Published by akaihola over 4 years ago