diff options
author | Sergio Martins <smartins@kde.org> | 2019-05-11 23:20:47 +0100 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2019-05-11 23:20:47 +0100 |
commit | b25cd28c3b8b855ffd5b40f6d8b9d598add993b0 (patch) | |
tree | b5619d0203b3bc7b9e0b875417bd1e85a829e223 | |
parent | 0380e066d442fdc6d09eb34e46205fbe6cae646c (diff) |
Polish the howto a bit
-rw-r--r-- | HOWTO | 25 |
1 files changed, 10 insertions, 15 deletions
@@ -1,7 +1,9 @@ +TODO: Use .md + Help on how to create a new check or a fixit -------------------------------------------------------------------------------- -Files to create or modify +Files to create or modify: checks/levelX/my-check.cpp checks/levelX/my-check.h @@ -9,6 +11,13 @@ checks/README-my-check.md tests/my-check/config.json tests/my-check/main.cpp ClazySources.cmake +checks.json +ChangeLog +README.md + +Just add your check to checks.json and run dev-scripts/generate.py --generate +which will generate the files you need to write, and edit others for you. + -------------------------------------------------------------------------------- Tips @@ -40,20 +49,6 @@ Using ASTMatchers -------------------------------------------------------------------------------- Tips for fixits -- Don't forget to register your fixit with: - REGISTER_FIXIT(MyFixEnumerator, "fix-my-check", "my-check") - Where the 1st argument is some enum value, which your create, mostly useful if you have more than one fixit type. - -- When testing main.cpp, the unit-test framework will automatically have fixits enabled, and a main.cpp_fixed.cpp is created. - You should add this to config.json, so that main.cpp_fixed.cpp is also compiled: - { - "filename" : "main.cpp_fixed.cpp", - "isFixedFile" : true - } - - The expected result is the main.cpp_fixed.cpp itself, so, if the file looks correctly fixed: - cp main.cpp_fixed.cpp main.cpp_fixed.cpp.expected - - Usually you'll have to poke around and debug print getLocStart and getLocEnd of statements until you find the locations you want, otherwise you'll have to manipulate the locations with Lexer, see FixItUtils.cpp. |