Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Fix --config handling and allow --append-config #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thejcannon
Copy link
Contributor

From my testing, passing --config ./file.toml wasn't being handled correctly.
Debugging it, it looks like parse_preliminary_options in flake8 strips out these options, so by the time we get to it in parse_configuration_and_cli they are nowhere to be found in argv.

@thejcannon
Copy link
Contributor Author

@orsinium this is good to be reviewed

@sscherfke
Copy link
Contributor

I tested the --config option and it now seems to work with this patch.

@@ -22,11 +22,11 @@
}


def get_installed(app) -> Iterator[Dict[str, Any]]:
def get_installed(app, argv=[]) -> Iterator[Dict[str, Any]]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't use mutable default arguments for functions.

@orsinium
Copy link
Member

Thank you for your contribution! Sorry for postponing the review of the PR. I'm still not sure what PR does, how it fixes the issue. Probably, I should try to debug it myself as well.

@sscherfke
Copy link
Contributor

W/o this patch, the --config option (and probaply the --apend-config option as well) does not work since it's stripped away by flake8 before flakehell has a chance to see it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants