-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let isort decide which config to use
isort will look for a configuration in pyproject.toml when the TOML library is available. flake8-isort has its own mechanism to look up an appropriate configuration file and will pass its path on to isort. Right now, flake8-isort doesn't consider pyproject.toml files as configuration file candidates and will raise an error if there's no other configuration file than the pyproject.toml. Luckily, there's the parameter `--no-isort-config` to make flake8-isort not stall when it cannot find a config file. In this case, isort will not be instructed to look for a specific configuration file by flake8-isort but instead look for it itself (beginning from either the currently linted file path or the current working directory). This is great because it means that we can rely on isort to figure out which config to use and linting behavior between both libraries will be exactly the same. The search for a configuration file can be removed from flake8-isort and we get Pyproject.toml support for free. The `--no-isort-config` option can be removed as well because from now on it will always be the burden of isort to figure out which config to use. Related to #71 Closes #78
- Loading branch information
Showing
3 changed files
with
20 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
701995a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't examined the code yet but this sounds like a better idea than my PR #78.