Skip to content

Releases: akaihola/darker

3.0.0

01 Sep 19:44
7f70a5b

Choose a tag to compare

Added

  • Ruff formatter support using the --formatter=ruff command line option or formatter = "ruff" configuration file option.
  • The --formatter=black option (the default) has been added.
  • pyupgrade is now supported as a formatter plugin (--formatter=pyupgrade on CLI, formatter = "pyupgrade" in config file). Note that changes from pyupgrade are applied on a per-fi>
  • --formatter=none now skips running Black, Ruff or pyupgrade. This is useful when you only want to run [isort](https://py>
  • The --preview configuration flag is now supported in the configuration files for Darker and Black.
  • Add official support for Python 3.13.
  • New exit codes 2 for file not found, 3 for invalid command line arguments, 4 for missing dependencies and 123 for unknown failures.
  • Display exit code in parentheses after error message.
  • Do not reformat renamed files.
  • Respect the skip_glob setting of isort.

Removed

  • Backwards incompatible change: Baseline linting support (-L/--lint option) has been removed. Use the Graylint tool instead.
  • Backwards incompatible change: Black is no longer installed by default. Use pip install 'darker[black]' to get Black support.
  • Drop support for Python 3.8.
  • In the Darker configuration file under [tool.darker], the Black configuration options skip_string_normalization and skip_magic_trailing_comma are no longer valid. Use [tool.black] instead.
  • Drop support for isort 5.1.x.
  • Drop support for Pylint earlier than 3.3.0.

Fixed

  • Update to Darkgraylib 2.4.0 to fix the configuration dump, the output of --version, the Git "dubious ownership" issue, and source code line splitting (see below).
  • In the configuration dump printed when -vv verbosity is used, the configuration section is now correctly named [tool.darker] instead of [tool.darkgraylib].
  • Pass Darker version to darkgraylib.command_line.make_argument_parser to make --version display the correct version number.
  • Pass full environment to Git to avoid the "dubious ownership" error.
  • Work around a pathlib.Path.resolve bug in Python 3.9 on Windows. The work-around should be removed when Python 3.9 is no longer supported.
  • Add missing configuration flag for Flynt.
  • Only split source code lines at Python's universal newlines (LF, CRLF, CR).
  • The Darker GitHub action now respects the working-directory input option.

Internal

  • CI workflow to post recent project activity in a discussion. Triggered manually.
  • CI "future" test now tests against main of Darkgraylib in addition to Black, Flynt and [isort](https://pycq>
  • Prevent Pylint from updating beyond version 3.2.7 due to dropped Python 3.8 support.
  • Invoking Black is now implemented as a plugin. This allows for easier integration of other formatters in the future. There's also a dummy none formatter plugin.
  • Update darkgray-dev-tools for Pip >= 24.1 compatibility.
  • Drop dependency on pip and distutils in the weekly CI "future" test. Use packaging instead.
  • No need to use [typing.Pattern]{.title-ref} instead of [re.Pattern]{.title-ref} in Python 3.9+.
  • Always use newest artifact upload/download actions from the v4 series in the CI build.
  • Use [datetime.datetime.now()]{.title-ref}, not .utcnow() to silence a deprecation warning.
  • Suppress logging about Flynt unless Flynt is enabled.
  • Update to Mypy 1.15+ and use the explicit-any ignore.
  • Switch from old defunct Bandit action to brunohaf/action-bandit.
  • Format YAML files to satisfy yaml-lint and fix workflow syntax.
  • Use UV across all CI workflow actions, and enable caching of packages.
  • Update Nix action to v31 -- fixes the build error.
  • Update to Pygments 2.15 to address two CVEs reported by Safety.
  • Use Pylint 3.3.0 or later and Graylint to lint only problems newly introduced by a PR.
  • Add ignores for the too-many-positional-arguments Pylint message.

2.1.1

16 Apr 12:20
0fcbba3

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

Choose a tag to compare

Added

  • Mark the Darker package as annotated with type hints.
  • Update to ioggstream/[email protected] 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

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

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

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

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

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

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

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.