-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config validation? #1308
Comments
seems pretty unfortunate, but had it been the tough thing about this is if the configuration would have been added incrementally you would have found this -- it seems that it was a bad copy paste error that led to this (the same sort of argument applies to test-driven-development) I'm not sure that there's much that can be done here without potentially breaking some existing use cases as error codes don't really have a restriction even though conventionally they have been 1-3 letters followed by 3 numbers (they can technically be any string!) -- maybe it's fine to break these users? |
also enforcing that would break your config for another reason (as shown from the first part of the parsed value) so I think this is not really actionable without breaking a lot of people so I'm going to decline this at this time |
I also intend to change this. Definitely had not realized it was being parsed this way, and would have preferred this to error. Ultimately, I think a fair amount of fault here lies with a permissive config format. I totally understand this being basically unfixable for backwards compatibility, externally developed plugins, and other tools reading these entries. I think a partial remedy here would be to increase user visibility into what options flake8 is actually applying at runtime. I tried
This is a bit pedantic, but I think the incremental addition actually hurt here. Initially, we only added per files ignores after fixing the report everywhere else. There, it was indistinguishable that the per-file report was actually masking everything because there were no other cases to report. When it was added all at once, I started noticing obvious cases where |
-vv has this information |
This is a feature request for more strict config validation.
Here is the issue that inspired this feature request: scverse/anndata#540
A space managed to be placed in front of the
per-file-ignore
line in our.flake8
config. This resulted in it being parsed as just another entry inignore
, and all elements in the following lines split by white space and added parsed as entries inignore
. Practically, this resulted in:This config
Parsing to this:
We didn't immediately notice because adding per-file-ignores still made errors go away. Unfortunately it was making them go away globally.
I would have expected this to throw an error at some point. This could have happened from invalid entries ending up in the
ignore
table, or (with a more structured config format) errors from levels of indentation varying so widely.I expect
pyproject.toml
(#234) support would have solved this particular issue since it would have been a parse error.Please describe how you installed Flake8
pip
, though this has also been installed as part of apre-commit
hook*Please provide the exact, unmodified output of `flake8 --bug-report`*
The text was updated successfully, but these errors were encountered: