Update to the new rule architecture#4589
Update to the new rule architecture#4589charliermarsh merged 25 commits intoastral-sh:mainfrom JonathanPlasse:update-to-the-new-rule-architecture
Conversation
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinuxWindows |
|
Could you extend the summary with an explanation of what is changing and why? I don't understand the reason why some modules are moved, making it hard to review the pr |
|
|
I'll take a look at this tonight. |
|
Thank you for this! I'm comfortable merging the rule reorganization, which is great and much appreciated. I think we should discuss the CI scripts separately. The scripts seem useful, and they clearly work! But I'm worried that they will be difficult to maintain since they are so tightly coupled to the specific organization, structure, and syntax used in our code. I might prefer to run them periodically rather than enforce them on CI. Can we move the scripts out to a separate PR, and merge the rule reorganization first? |
|
Oh sorry, I see that #3747 contains the scripts themselves. Can we update this PR such that it's independently mergeable? |
Just rebased this branch on main. |
The scripts
add_rule.pyonly work correctly when we use the following rule architecture when there is a rules folder that contains a file for each rule. Like this adding a rule consist of adding an entry in mod.rs and a new rule file and some other changes.Without this change
add_rule.pywill create the files like in the new architecture but it will not compile as it requires changing manually the generated files.New architecture
Old architecture
Here is an example with flake8_async:
flake8_async/rules/mod.rs
flake8_async/rules/new_rule.rs