Skip to content

reformat checklist #83

Closed
Closed

Description

@jakkdl

Copied out from #81

  • Get rid of visitors manually visiting subnodes irrelevant with libcst

    • some possible solutions, either these two
      • exit_Xxx which is called for a node after it's subnodes have been visited (would clean up all cases of self.generic_visit(node) being used)
      • visit functions for node parts that in the AST don't have dedicated nodes, e.g. visit_Finally or visit_WhileElse. This would split up several long functions and solve the last cases of revisits - only trouble child would be 107_108.visit_loop, which explicitly wants to visit the body twice atm, but I could probably rewrite that
    • Or visitor classes implement a visit_Xxx as a pseudo-contextmanager, with enter and exit as magic names, and other names called as they match up with the _fields of the visited node. And the external runner handles a visit different depending on if it's isinstance function or class
  • Split main file #103 I'm also starting to want to split up flake8_trio.py into different files, 1500 lines is starting to be quite inconvenient to navigate, and get any overview on - I also know you are hesitant to split given installation complications so would have to take care when doing that.

  • runner now skips unselected visitors #91

  • don't hard code unnecessary variables in Flake8TrioVisitor.get_state - it would most likely just mean renaming a lot of variables. But is bound to introduce bugs in it's current state so plan to fix it soon after merge.

  • Move eval files into a separate directory #102 Move all trioxxx.py files into a subdirectory of tests/ so it's clear what files contains tests and which ones contain test data. Can then also get rid of regex and naming restrictions on files.

Activity

  1. self-assigned this
    on Dec 19, 2022
  2. jakkdl commented on Dec 31, 2022

    @jakkdl
    MemberAuthor

    Added:

    Move all trioxxx.py files into a subdirectory of tests/ so it's clear what files contains tests and which ones contain test data. Can then also get rid of regex and naming restrictions on files.

  3. jakkdl commented on Feb 13, 2023

    @jakkdl
    MemberAuthor

    1st one is obsolete with the upcoming libcst rewrite, and the fourth one was recently fixed, so this is now closed~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions