Skip to content

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

Closed

Description

@Zac-HD

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

Activity

  1. jakkdl commented on Dec 18, 2022

    @jakkdl
    Member

    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.

  2. jakkdl commented on Dec 18, 2022

    @jakkdl
    Member

    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)

  3. jakkdl commented on Dec 19, 2022

    @jakkdl
    Member
  4. Zac-HD commented on Dec 19, 2022

    @Zac-HD
    MemberAuthor

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

  5. added 2 commits that reference this issue on Dec 29, 2022
    e037c92
    8cc9e52
  6. added a commit that references this issue on Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions