Open asottile opened 3 years ago
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:
In GitLab by @graingert on Jul 13, 2020, 09:01
moved from https://gitlab.com/pycqa/flake8/-/merge_requests/442
/cc @ericvw @asottile
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 the paths
option and is aware of each configuration file's location.
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 :cry:.
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 flake8
invocations for each directory tree which has flake8
configuration files.
In GitLab by @graingert on Jul 13, 2020, 08:57
Please describe how you installed Flake8
pre-commit of course
Please provide the exact, unmodified output of
flake8 --bug-report
Please describe the problem or feature
the paths are resolved relative to all paths not just the one the path directive is found in eg:
when running
flake8 --append-config=foo/bar/.flake8 --append-config=foo/.flake8
flake8 will addfoo/baz
andfoo/bar/baz
to LocalPlugins.paths