Releases: akaihola/darker
Releases · akaihola/darker
3.0.0
Added
- Ruff formatter support using the
--formatter=ruffcommand line option orformatter = "ruff"configuration file option. - The
--formatter=blackoption (the default) has been added. - pyupgrade is now supported as a formatter plugin (
--formatter=pyupgradeon CLI,formatter = "pyupgrade"in config file). Note that changes from pyupgrade are applied on a per-fi> --formatter=nonenow skips running Black, Ruff or pyupgrade. This is useful when you only want to run [isort](https://py>- The
--previewconfiguration 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_globsetting of isort.
Removed
- Backwards incompatible change: Baseline linting support (
-L/--lintoption) 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 optionsskip_string_normalizationandskip_magic_trailing_commaare 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
-vvverbosity is used, the configuration section is now correctly named[tool.darker]instead of[tool.darkgraylib]. - Pass Darker version to
darkgraylib.command_line.make_argument_parserto make--versiondisplay the correct version number. - Pass full environment to Git to avoid the "dubious ownership" error.
- Work around a
pathlib.Path.resolvebug 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-directoryinput option.
Internal
- CI workflow to post recent project activity in a discussion. Triggered manually.
- CI "future" test now tests against
mainof 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
noneformatter plugin. - Update
darkgray-dev-toolsfor Pip >= 24.1 compatibility. - Drop dependency on
pipanddistutilsin the weekly CI "future" test. Usepackaginginstead. - 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-anyignore. - 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-argumentsPylint message.
2.1.1
Added
- In the Darker configuration file under
[tool.darker], the Black configuration optionsskip_string_normalizationandskip_magic_trailing_commahave 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.pyscript was moved to thedarkgray-dev-toolsrepository.
Fixed
- A dash (
-) is now allowed as the single source filename when using the--stdoutoption. 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
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
masterbranch 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.pyis now in the separatedarkgray-dev-toolsrepository.- 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.Zinstead ofX.Y.Z. - Escape pipe symbols (
|) in the README to avoid RestructuredText rendering issues. - Compatibility with Flynt 0.78.0 and newer.
2.0.0
Added
- The command
darker --config=check-darker.tomlnow 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.tomlhas
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.pyin 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 --helpand its output as
includedREADME.rstin case the two differ.
Removed
- Drop support for Python 3.7 which has reached end of life.
shlex_joincompatibility wrapper for Python 3.7 and earlier.- Move linting support to Graylint_ but keep the
-L/--lintoption 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.ASTSafetyErrorinstead
ofAssertionErrorwhen 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
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_captureoption in Pytest configuration.- Ignore some linter messages by recent versions of linters used in CI builds.
1.7.2
Added
- Add a
Newslink on the PyPI page. - Allow
-as the single source filename when using the--stdin-filenameoption.
This makes the option compatible with Black. - Upgrade NixOS tests to use Python 3.11 on both Linux and macOS.
Fixed
- Revert running
commit-rangefrom 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__.pyin the repository root. - Upgrade
install-nix-actionto version 22 in CI to fix an issue with macOS. - Allow
--target-version=py312since newest Black supports it. - Allow a comment in milestone titles in the
bump_versionscript.
1.7.1
Added
- Prefix GitHub milestones with
Darkerfor clarity since we'll have two additional related repositories soon in the same project.
Fixed
- Use
git worktreeto create a repository checkout for baseline linting. This avoids issues with the previousgit cloneandgit checkoutbased approach. - Disallow Flynt version 0.78 and newer to avoid an internal API incompatibility.
- In CI builds, run the
commit-rangeaction from the current checkout instead of pointing to a release tag. This fixes workflows when in a release branch. - Linting fixes: Use
stacklevel=2inwarnings.warn()calls as suggested by Flake8; skip Bandit check for virtualenv creation in the GitHub Action; useignore[method-assign]as suggested by Mypy.
1.7.0
Added
-f/--flyntoption 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-versioncommand line option - In
README.rst, link to GitHub searches which find public repositories that use Darker. - Linters are now run twice: once for
rev1to get a baseline, and another time forrev2to 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=PATHnow allows reading contents of a single file from standard input. This also makes:STDIN:, a new magic value, the defaultrev2for--revision.- Add configuration for
darglintandflake8-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
pipcommand. 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
shlexfrom the Python standard library. This deals with quoting correctly. - Configure
coverageto use relative paths in the Darker repository. This enables use ofcov_to_lint.py - Satisfy Pylint's
use-dict-literalcheck in Darker's code base. - Use
!rto quote values in format strings as suggested by recent Flake8 versions.
1.6.1
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 inCONTRIBUTING.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+gffaaf48and later – an argument was
replaced inblack.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-versionworkflow will now succeed also in a release branch.
1.6.0
Added
- Upgrade linters in CI and modify code to satisfy their new requirements.
- Upgrade to
setup-python@v4in all GitHub workflows.
Fixed
- Fix compatibility with
black-22.10.1.dev19+gffaaf48and later – an argument was
replaced inblack.files.gen_python_files(). - Upgrade CI to use environment files instead of the deprecated
set-outputmethod. - Fix Safety check in CI.
- Don't do a development install in the
help-in-readme.ymlworkflow. Something
broke this recently.