Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isort ignores headings #306

Closed
mgorfer opened this issue Jul 14, 2023 · 1 comment
Closed

Isort ignores headings #306

mgorfer opened this issue Jul 14, 2023 · 1 comment
Labels
triage-needed Issue is not triaged.

Comments

@mgorfer
Copy link

mgorfer commented Jul 14, 2023

Using the VSCcode isort extension, the custom headings which I defined in my isort.cfg in the root of my repository are ignored.
The known_first_party modules from that file are recognized though and everything is moved to the correct section (without headings).
Using isort in the terminal, the correct headings as defined in my isort.cfg are applied.

When specifying this file in the isort.args using ["--settings-file", "xyz/.isort.cfg"] in my VSCode settings.json, the headings are applied.

My isort.cfg:

[settings]
default_section=THIRDPARTY
known_first_party=module_a, module_b
import_heading_future=Future
import_heading_stdlib=Standard Library
import_heading_thirdparty=Third party
import_heading_firstparty=First party
import_heading_localfolder=Local imports
lines_between_types=1
profile=black
@github-actions github-actions bot added the triage-needed Issue is not triaged. label Jul 14, 2023
@karthiknadig
Copy link
Member

karthiknadig commented Jul 14, 2023

@mgorfer This is a bug in isort itself. See PyCQA/isort#1989

Unfortunately, they have not released it yet (see https://github.com/PyCQA/isort/blob/main/CHANGELOG.md).

The workaround is to specify the config file manually.

Duplicate of #53

@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

2 participants