darker

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

Downloads
69.6K
Stars
631
Committers
36
darker - Version 1.2.1

Published by akaihola almost 4 years ago

Added

  • Travis CI now runs Pylint on modified lines via pytest-darker
  • Darker can now be used as a pre-commit hook (see pre-commit)
  • Document integration with Vim
  • Thank all contributors right in the README
  • RevisionRange class and Git repository test fixture improvements in preparation for a larger refactoring coming in #80

Fixed

  • Improve example in README and clarify that path argument can also be a directory
darker - Version 1.2.0

Published by akaihola about 4 years ago

  • Configuration for Darker can now be done in pyproject.toml.
  • The formatting of the Darker code base itself is now checked using Darker itself and pytest-darker. Currently the formatting is a mix of Black 19.10 and Black 20.8 rules, and Travis CI only requires Black 20.8 formatting for lines modified in merge requests. In a way, Darker is now eating its own dogfood.
  • Support commit ranges for -r/--revision. Useful for comparing to the best common ancestor, e.g. master....
  • Configure Flake8 verification for Darker's own source code
darker - Version 1.1.0

Published by akaihola about 4 years ago

This version makes Darker usable for checking feature branches in a CI system.

Added

  • -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
  • Untracked Python files – e.g. those added recently – are now also reformatted
  • -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
  • The --diff option will highlight syntax on screen if the pygments package is available.

Fixed

  • Paths from --diff are now relative to current working directory, similar to output from black --diff, and blank lines after the lines markers (@@ ... @@) have been removed.
darker - Version 1.0.0

Published by akaihola over 4 years ago