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

reformat checklist #83

Closed
5 tasks done
jakkdl opened this issue Dec 16, 2022 · 2 comments
Closed
5 tasks done

reformat checklist #83

jakkdl opened this issue Dec 16, 2022 · 2 comments
Assignees

Comments

@jakkdl
Copy link
Member

jakkdl commented Dec 16, 2022

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.

@jakkdl jakkdl self-assigned this Dec 19, 2022
@jakkdl
Copy link
Member Author

jakkdl commented Dec 31, 2022

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.

@jakkdl
Copy link
Member Author

jakkdl commented Feb 13, 2023

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

@jakkdl jakkdl closed this as completed Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant