Closed Zac-HD closed 1 year ago
I think the actual problem here is flake8's comma_separated_list
.. apparently treating spaces as commas?
flake8 --no-checkpoint-warning-decorators="a b, c d" <file>
ipdb> self.options.no_checkpoint_warning_decorators
['a', 'b', 'c', 'd']
EDIT: No, I think that's a separate problem? Maybe.
New try: It looks like the action
parameter to flake8.options.manager.OptionManager.add_option()
is entirely ignored when parsing a config file. The supplied function is never called, and it's the same thing with ListOfIdentifiers
for --startable-in-context-manager
, invalid identifiers aren't flagged. Instead the values are just accepted straight up.
Passing the same values at the command line works as expected.
Will delve more into flake8's internals to figure out what's going on, and probs open an issue over there. I'm opening a PR with a dirty workaround, travelling to family for holidays in the coming days so a more thorough exploration might be delayed.
(and then also fix spaces)
Apparently we should just avoid action
entirely and use type
instead https://github.com/PyCQA/flake8/issues/1770#issuecomment-1358067558 🤷
I get an error on line 1353 because it hasn't been parsed from list-of-strings into a dict:
https://github.com/Zac-HD/flake8-trio/blob/7cdd9180e3aefca89d1a58d197022f266b45868c/flake8_trio.py#L1350-L1356
I also started on a quick regression test, but don't have time to finish it right now: https://github.com/Zac-HD/flake8-trio/compare/config-error