You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
local-plugins relative paths are resolved relative to all paths not just the one the path directive is found #759
Yeah, this is similar to #517, which has been non-trivial in working towards.
The configuration handling is a bit convoluted and I've been trying to work towards having a common place where path normalization occurs relative to the configuration file. I haven't spent much time on the plugin configuration. However, for other options, the core problem is the configuration files are all merged together first, and then path normalization occurs. It's not as straight-forward to re-order the steps.
The code you linked to here may be easier to change because get_local_plugins() seems to special case the paths option and is aware of each configuration file's location.
This is the same as #517, more or less. ConfigFileFinder.local_configs_with_files() is called, which merges all options into one configuration object 😢.
Unfortunately, I've been lacking spare cycles lately. I'll see if I can find some towards making more progress in this area.
Thanks for raising the issue because it's useful for me to know where path normalization occurs :).
Without knowing all your configuration options, a workaround to this issue is to have separate flake8 invocations for each directory tree which has flake8 configuration files.
Activity
asottile commentedon Apr 3, 2021
In GitLab by @graingert on Jul 13, 2020, 09:00
here the code is looking at all the base dirs of all the config files, and doesn't associate the configs' path to the config file it was found in:
https://gitlab.com/pycqa/flake8/blob/a7be77f761a4c29121d6bb6f61c11902281f9105/src/flake8/options/config.py#L345-371
asottile commentedon Apr 3, 2021
In GitLab by @graingert on Jul 13, 2020, 09:01
moved from https://gitlab.com/pycqa/flake8/-/merge_requests/442
/cc @ericvw @asottile
asottile commentedon Apr 3, 2021
In GitLab by @ericvw on Jul 13, 2020, 09:19
Yeah, this is similar to #517, which has been non-trivial in working towards.
The configuration handling is a bit convoluted and I've been trying to work towards having a common place where path normalization occurs relative to the configuration file. I haven't spent much time on the plugin configuration. However, for other options, the core problem is the configuration files are all merged together first, and then path normalization occurs. It's not as straight-forward to re-order the steps.
The code you linked to here may be easier to change because
get_local_plugins()seems to special case thepathsoption and is aware of each configuration file's location.asottile commentedon Apr 3, 2021
In GitLab by @ericvw on Jul 13, 2020, 09:35
This is the same as #517, more or less.
ConfigFileFinder.local_configs_with_files()is called, which merges all options into one configuration object 😢.asottile commentedon Apr 3, 2021
In GitLab by @ericvw on Jul 13, 2020, 09:43
Unfortunately, I've been lacking spare cycles lately. I'll see if I can find some towards making more progress in this area.
Thanks for raising the issue because it's useful for me to know where path normalization occurs :).
Without knowing all your configuration options, a workaround to this issue is to have separate
flake8invocations for each directory tree which hasflake8configuration files.