Factored out some similar code in add_new_check.py and rename_check.py.
Made rename_check.py less error prone by targetting string replacements
Haven't linted the code as that is a can of worms given the 100+ different style options currently used in the python files
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It'll be reasonable to have script to create check alias, but this could be made in separate patch.
clang-tools-extra/clang-tidy/add_new_check.py | ||
---|---|---|
18 | It's better to use import utils.modify_check. See Flake8. | |
153 | Double line spacing may be intentional. For example, Flake8 enforces such rules. | |
clang-tools-extra/clang-tidy/rename_check.py | ||
15 | It's better to use import utils.modify_check. See Flake8. | |
111 | It's better to open files with with operator. Same in other places. |
Feel free to apply this and see how it works. Tested with checks that have alias variants which seem to respond well. Renaming a check then renaming it back reverts the state to how it was before apart from release notes and maybe some non standard comments
I just stuck to the trusty old c++ naming conventions. Having a look I see most of it is using lower_case for all identifiers but then in there are always failures in the files along with that
It's better to use import utils.modify_check. See Flake8.