Skip to content

Releases: akaihola/darker

2.1.1

16 Apr 12:20
0fcbba3
Compare
Choose a tag to compare

Added

  • In the Darker configuration file under [tool.darker], the Black configuration options skip_string_normalization and skip_magic_trailing_comma have been deprecated and will be removed in Darker 3.0. A deprecation warning is now displayed if they are still used.

Removed

  • The release_tools/update_contributors.py script was moved to the darkgray-dev-tools repository.

Fixed

  • A dash (-) is now allowed as the single source filename when using the --stdout option. This makes the option compatible with the new Black extension for VSCode.
  • Badge links in the README on GitHub.
  • Handling of relative paths and running from elsewhere than repository root.

2.1.0

27 Mar 21:13
cfb1626
Compare
Choose a tag to compare

Added

  • Mark the Darker package as annotated with type hints.
  • Update to ioggstream/bandit-report-artifacts@v1.7.4 in CI.
  • Support for Python 3.12 in the package metadata and the CI build.
  • Update to Black 24.2.x and isort 5.13.x in pre-commit configuration.
  • Test against Flynt master branch in the CI build.
  • Update to Darkgraylib 1.1.1 to get fixes for README formatting.
  • Improved "How does it work?" section in the README.
  • README section on limitations and work-arounds.

Removed

  • bump_version.py is now in the separate darkgray-dev-tools repository.
  • Skip tests on Python 3.13-dev in Windows and macOS. C extension builds are failing,
    this exclusion is to be removed when Python 3.13 has been removed.

Fixed

  • Bump-version pre-commit hook pattern: rev: vX.Y.Z instead of X.Y.Z.
  • Escape pipe symbols (|) in the README to avoid RestructuredText rendering issues.
  • Compatibility with Flynt 0.78.0 and newer.

2.0.0

13 Mar 20:54
645ae0b
Compare
Choose a tag to compare

Added

  • The command darker --config=check-darker.toml now runs Flake8, Mypy,
    pydocstyle, Pylint and Ruff on modified lines in Python files. Those tools are
    included in the [test] extra.
  • The minimum Ruff version is now 0.0.292. Its configuration in pyproject.toml has
    been updated accordingly.
  • The contribution guide now gives better instructions for reformatting and linting.
  • Separate GitHub workflow for checking code formatting and import sorting.
  • Also check the action, release tools and setup.py in the build workflows.
  • Require Darkgraylib 1.0.x and Graylint 1.0.x.
  • Update 3rd party GitHub actions to avoid using deprecated NodeJS versions.
  • CI build now shows a diff between output of darker --help and its output as
    included README.rst in case the two differ.

Removed

  • Drop support for Python 3.7 which has reached end of life.
  • shlex_join compatibility wrapper for Python 3.7 and earlier.
  • Move linting support to Graylint_ but keep the -L/--lint option for now.
  • Move code used by both Darker and Graylint_ into the Darkgraylib_ library.
  • Don't run pytest-darker_ in the CI build. It's lagging quite a bit behind.

Fixed

  • Black 24.2.0 compatibility by using the new darkgraylib.files.find_project_root
    instead of the implementation in Black.
  • Black 24.2.1 compatibility by detecting the new black.parsing.ASTSafetyError instead
    of AssertionError when Black>=24.2.1 is in use.
  • Make sure NixOS_ builds have good SSL certificates installed.
  • Work around some situations where Windows errors due to a too long Git command line.

1.7.3

27 Feb 08:43
d90b545
Compare
Choose a tag to compare

Added

  • Limit Black to versions before 24.2 until the incompatibility is resolved.
  • Stop testing on Python 3.7. Note: dropping support to be done in a separate PR.

Fixed

  • Typos in README.
  • Usage of the Black gen_python_files(gitignore_dict=...) parameter.
  • show_capture option in Pytest configuration.
  • Ignore some linter messages by recent versions of linters used in CI builds.

1.7.2

12 Jul 19:02
ddcd430
Compare
Choose a tag to compare

Added

  • Add a News link on the PyPI page.
  • Allow - as the single source filename when using the --stdin-filename option.
    This makes the option compatible with Black.
  • Upgrade NixOS tests to use Python 3.11 on both Linux and macOS.

Fixed

  • Revert running commit-range from the repository itself. This broke the GitHub
    action.
  • Python 3.12 compatibility in multi-line string scanning.
  • Python 3.12 compatibility for the GitHub Action.
  • Use the original repository working directory name as the name of the temporary
    directory for getting the linter baseline. This avoids issues with Mypy when there's
    an __init__.py in the repository root.
  • Upgrade install-nix-action to version 22 in CI to fix an issue with macOS.
  • Allow --target-version=py312 since newest Black supports it.
  • Allow a comment in milestone titles in the bump_version script.

1.7.1

26 Mar 10:31
959cc56
Compare
Choose a tag to compare

Added

  • Prefix GitHub milestones with Darker for clarity since we'll have two additional related repositories soon in the same project.

Fixed

  • Use git worktree to create a repository checkout for baseline linting. This avoids issues with the previous git clone and git checkout based approach.
  • Disallow Flynt version 0.78 and newer to avoid an internal API incompatibility.
  • In CI builds, run the commit-range action from the current checkout instead of pointing to a release tag. This fixes workflows when in a release branch.
  • Linting fixes: Use stacklevel=2 in warnings.warn() calls as suggested by Flake8; skip Bandit check for virtualenv creation in the GitHub Action; use ignore[method-assign] as suggested by Mypy.

1.7.0

11 Feb 18:14
6515b5d
Compare
Choose a tag to compare

Added

  • -f / --flynt option for converting old-style format strings to f-strings as supported in Python 3.6+.
  • Make unit tests compatible with pytest --log-cli-level==DEBUG. Doctests are still incompatible due to
    pytest#5908 <https://github.com/pytest-dev/pytest/issues/5908>_.
  • Black's target-version = configuration file option and -t / --target-version command line option
  • In README.rst, link to GitHub searches which find public repositories that use Darker.
  • Linters are now run twice: once for rev1 to get a baseline, and another time for rev2 to get the current situation. Old linter messages which fall on unmodified lines are hidden, so effectively the user gets new linter messages introduced by latest changes, as well as persistent linter messages on modified lines.
  • --stdin-filename=PATH now allows reading contents of a single file from standard input. This also makes :STDIN:, a new magic value, the default rev2 for --revision.
  • Add configuration for darglint and flake8-docstrings, preparing for enabling those linters in CI builds.

Fixed

  • Compatibility of highlighting unit tests with Pygments 2.14.0.
  • In the CI test workflow, don't use environment variables to add a Black version constraint to the pip command. This fixes the Windows builds.
  • Pass Git errors to stderr correctly both in raw and encoded subprocess output mode.
  • Add a work-around for cleaning up temporary directories. Needed for Python 3.7 on Windows.
  • Split and join command lines using shlex from the Python standard library. This deals with quoting correctly.
  • Configure coverage to use relative paths in the Darker repository. This enables use of cov_to_lint.py
  • Satisfy Pylint's use-dict-literal check in Darker's code base.
  • Use !r to quote values in format strings as suggested by recent Flake8 versions.

1.6.1

28 Dec 20:08
6e363e7
Compare
Choose a tag to compare

Added

  • Declare Python 3.11 as supported in package metadata.
  • Document how to set up a development environment, run tests, run linters and update
    contributors list in CONTRIBUTING.rst.
  • Document how to pin reformatter/linter versions in pre-commit.

Fixed

  • Pin Black to version 22.12.0 in the CI build to ensure consistent formatting of
    Darker's own code base.
  • Fix compatibility with black-22.10.1.dev19+gffaaf48 and later – an argument was
    replaced in black.files.gen_python_files().
  • Fix tests to work with Git older than version 2.28.x.
  • GitHub Action example now omits revision: since the commit range is obtained
    automatically.
  • test-bump-version workflow will now succeed also in a release branch.

1.6.0

20 Dec 09:23
7057de2
Compare
Choose a tag to compare

Added

  • Upgrade linters in CI and modify code to satisfy their new requirements.
  • Upgrade to setup-python@v4 in all GitHub workflows.

Fixed

  • Fix compatibility with black-22.10.1.dev19+gffaaf48 and later – an argument was
    replaced in black.files.gen_python_files().
  • Upgrade CI to use environment files instead of the deprecated set-output method.
  • Fix Safety check in CI.
  • Don't do a development install in the help-in-readme.yml workflow. Something
    broke this recently.

Release 1.5.1

11 Sep 16:25
45463a5
Compare
Choose a tag to compare

Added

  • Add a CI workflow which verifies that the darker --help output in README.rst
    is up to date.
  • Only run linters, security checks and package builds once in the CI build.
  • Small simplification: It doesn't matter whether isort was run or not, only
    whether changes were made.
  • Refactor Black and isort file exclusions into one data structure.

Fixed

  • darker --revision=a..b . now works since the repository root is now always
    considered to have existed in all historical commits.
  • Ignore linter lines which refer to non-Python files or files outside the common root
    of paths on the command line. Fixes a failure when Pylint notifies about obsolete
    options in .pylintrc.
  • For linting Darker's own code base, require Pylint 2.6.0 or newer. This avoids the
    need to skip the obsolete bad-continuation check now removed from Pylint.
  • Fix linter output parsing for full Windows paths which include a drive letter.
  • Stricter rules for linter output parsing.