Simplify configuration file search to be relative to cwd
The starting point to search for the configuration file was based on the common prefix of the
filenames positional arguments or
. (i.e., the cwd) if no
filenames were present. There is a strange situation where an invocation of
flake8 outside of a project tree could end up with detecting a configuration file based on the common prefix shared by
filenames provided as positional arguments.
To bring consistency towards how the configuration file is detected, regardless of the positional arguments provided, only search relative to the invocation of the current working directory of
flake8. While the change is technically backward-incompatible, the aforementioned situation is most likely a rare occurrence. One could argue the current behavior is "buggy" because of the inconsistency
Users impacted will either need to change their current working directory when invoking
flake8 or pass the
Note that this change helps towards pre-configuration CLI parsing and layering two
argparse.ArgumentParser objects with the
parents parameter passed at construction.
It may be easiest to review each commit in-order to follow along with the approach I took for making this change. The goal I had was to ensure each commit, in isolation, passes tests and any other linting/documentation checks.