Darker

Latest version: v2.1.1

Safety actively analyzes 675388 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 5

1.7.0

===================

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
`pytest5908 <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

===================

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``.
- Clarify configuration of reformatter/linter tools in README and ``--help``.

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

===================

Added
-----
- Upgrade linters in CI and modify code to satisfy their new requirements.
- Upgrade to ``setup-pythonv4`` in all GitHub workflows.
- ``bump_version.py`` now accepts an optional GitHub token with the ``--token=``
argument. The ``test-bump-version`` workflow uses that, which should help deal with
GitHub's API rate limiting.

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.

1.5.1

===================

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.

1.5.0

===================

Added
-----
- The ``--workers``/``-W`` option now specifies how many Darker jobs are used to
process files in parallel to complete reformatting/linting faster.
- Linters can now be installed and run in the GitHub Action using the ``lint:`` option.
- Sort imports only if the range of modified lines overlaps with changes resulting from
sorting the imports.
- Allow force enabling/disabling of syntax highlighting using the ``color`` option in
``pyproject.toml``, the ``PY_COLORS`` and ``NO_COLOR`` environment variables, and the
``--color``/``--no-color`` command line options.
- Syntax highlighting is now enabled by default in the GitHub Action.
- ``pytest>=6.2.0`` now required for the test suite due to type hinting issues.

Fixed
-----
- Avoid memory leak from using ``lru_cache`` on a method.
- Handle files encoded with an encoding other than UTF-8 without an exception.
- The GitHub Action now handles missing ``revision:`` correctly.
- Update ``cachix/install-nix-action`` to ``v17`` to fix macOS build error.
- Downgrade Python from 3.10 to 3.9 in the macOS NixOS_ build on GitHub due to a build
error with Python 3.10.
- Darker now reads its own configuration from the file specified using
``-c``/``--config``, or in case a directory is specified, from ``pyproject.toml``
inside that directory.

1.4.2

===================

Added
-----
- Document ``isort``'s requirement to be run in the same environment as
the modules which are processed.
- Document VSCode and ``--lint``/``-L`` incompatibility in the README.
- Guard against breaking changes in ``isort`` by testing against its ``main``
branch in the ``test-future`` GitHub Workflow.
- ``release_tools/bump_version.py`` script for incrementing version numbers and
milestone numbers in various files when releasing.

Fixed
-----
- Fix NixOS_ builds when ``pytest-darker`` calls ``pylint``. Needed to activate
the virtualenv.
- Allow more time to pass when checking file modification times in a unit test.
Windows tests on GitHub are sometimes really slow.
- Multiline strings are now always reformatted completely even if just a part
was modified by the user and reformatted by Black_. This prevents the
"back-and-forth indent" symptom.

Page 2 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.