Description
Copied out from #81
-
Get rid of visitors manually visiting subnodesirrelevant 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
andexit
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
- some possible solutions, either these two
-
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.
-
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 oftests/
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.