Skip to content
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

trio200-blocking-calls = is loaded but not parsed from a config file #84

Closed
Zac-HD opened this issue Dec 17, 2022 · 4 comments · Fixed by #93
Closed

trio200-blocking-calls = is loaded but not parsed from a config file #84

Zac-HD opened this issue Dec 17, 2022 · 4 comments · Fixed by #93
Assignees
Labels
bug Something isn't working

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Dec 17, 2022

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

@Zac-HD Zac-HD added the bug Something isn't working label Dec 17, 2022
@jakkdl
Copy link
Member

jakkdl commented Dec 18, 2022

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.

@jakkdl
Copy link
Member

jakkdl commented Dec 18, 2022

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)

@jakkdl jakkdl mentioned this issue Dec 18, 2022
@jakkdl
Copy link
Member

jakkdl commented Dec 19, 2022

Opened PyCQA/flake8#1770 and PyCQA/flake8#1771

@Zac-HD
Copy link
Member Author

Zac-HD commented Dec 19, 2022

Apparently we should just avoid action entirely and use type instead PyCQA/flake8#1770 (comment) 🤷

jakkdl added a commit to jakkdl/flake8-async that referenced this issue Dec 29, 2022
… and --trio200-blocking-calls now handle spaces and newlines
jakkdl added a commit to jakkdl/flake8-async that referenced this issue Dec 29, 2022
… and --trio200-blocking-calls now handle spaces and newlines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants