gforcada/flake8-isort

Incomplete pyproject.toml support

Closed this issue · 3 comments

While 53bc302 added isort with pyproject.toml support as a dependency,
it was missed to update the _search_config_on_path method to also
look for a tool.isort section in pyproject.toml:

def _search_config_on_path(self, path):
# type: (str) -> Optional[str] # noqa: F821
"""Search for isort configuration files at the specifed path.
Args:
path: The path to search for config files on.
Return:
str: the isort config if found otherwise, None
"""
for config_file in ('.isort.cfg', '.editorconfig'):
config_file_path = os.path.join(path, config_file)
if os.path.isfile(config_file_path):
return config_file_path
# Check for '[isort]' section in other configuration files.
for config_file in ('tox.ini', 'setup.cfg', '.flake8'):
config_file_path = os.path.join(path, config_file)
config = SafeConfigParser()
config.read(config_file_path)
if 'isort' in config.sections():
return config_file_path
return None

If you currently have tool.isort section in pyproject.toml, you always get the following error:
I002 no configuration found (.isort.cfg or [isort] in configs)

jnns commented

Thanks for mentioning this. There's already a pull request to improve support for pyproject.toml and that will resolve this issue.

Can we close this since #79 is merged?

@caiolopes yes, thanks for taking the time to review what can be closed already 💯