config: Normalize paths in CLI-specified config relative to config dir

Paths specified in configuration files should be relative to the
directory where the configuration file resides.  Formerly, paths were
normalized relative to the current working directory where `flake8` was
invoked.  The former behavior was not expected, especially for directory
structures with subprojects each having their own configuration.
This commit is contained in:
Eric N. Vander Weele 2020-05-18 17:12:07 -04:00
parent 8be5a7294b
commit 563220b711
2 changed files with 8 additions and 7 deletions

View file

@ -265,7 +265,7 @@ class MergedConfigParser(object):
return {}
LOG.debug("Parsing CLI configuration files.")
return self._parse_config(config)
return self._parse_config(config, os.path.dirname(config_path))
def merge_user_and_local_config(self):
"""Merge the parsed user and local configuration files.