8000 `isort`: `skip_glob` option doesn't work · Issue #615 · akaihola/darker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
isort: skip_glob option doesn't work #615
Open
@ranelpadon

Description

@ranelpadon

Describe the bug
We have Django files/settings that have intentional import ordering to avoid issues. Hence, we exclude them when fixing the imports using isort via skip_glob option.

This is the relevant setting in pyproject.toml (--isort option is set in it):

[tool.darker]
isort = true  # Run the `isort` also when running `darker`.

[tool.isort]
# https://pycqa.github.io/isort/docs/configuration/options.html
skip_glob = ['*/conf/settings/*']  # Exclude the Settings files due to sensitive imports.
filter_files = true  # Exclude the file if applicable even if it's explicitly specified. 

Using isort works (i.e. the applicable file is excluded):

$ isort conf/settings/backoffice.py --diff
Skipped 1 files

However, using darker will still show the --isort diff which is unexpected:

$ darker conf/settings/backoffice.py --diff
...

To Reproduce
Basically, edit a Python file that is part of the skip_glob pattern. Notice that darker will not exclude it when fixing imports.

Expected behavior
Just like the stand-alone isort, darker --isort should exclude the file since it's skipped via glob.

Environment

  • OS: macOS 12.5 Monterey
  • Python version: 3.11.0
  • Git version: 2.39.1
  • Darker version: 2.1.1
  • Black version: 24.4.2
  • Isort version: 5.13.2

Note that when using darker via pre-commit, it's the same issue: those supposed to be skipped files via glob pattern are still being linted by the --isort option which is unexpected.

PS: Thanks for this excellent project. :)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status

In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0