600# 1. use the TableGen (https://llvm.org/docs/TableGen/) for generation of the list of diagnostics
601#
602# cd <src_dir>/clang/include/clang/Basic/
603# <src_dir>/build/bin/llvm-tblgen -dump-json <src_dir>/clang/include/clang/Basic/Diagnostic.td > output.json604#
605# 2. generate the new version of the rules file
606#
597# - Clang is included
598# 3. Build LLVM and Clang
599#
600# 1. use the TableGen (https://llvm.org/docs/TableGen/) for generation of the list of diagnostics601#
602# cd <src_dir>/clang/include/clang/Basic/
603# <src_dir>/build/bin/llvm-tblgen -dump-json <src_dir>/clang/include/clang/Basic/Diagnostic.td > output.json
584# meld clangtidy.xml clangtidy_new.xml.comparable
585#
586# 4. optional: try to fix local urls in the documentation
587# python clangtidy_createrules.py rules_fixurls <src_dir>clang-tools-extra/docs/clang-tidy/checks > clangtidy_new.xml588# python utils_createrules.py comparerules clangtidy.xml clangtidy_new.xml
589# meld clangtidy.xml clangtidy_new.xml.comparable
590#
577# 1. Check out LLVM (https://github.com/llvm/llvm-project.git)
578#
579# 2. generate the new version of the rules file
580# python clangtidy_createrules.py rules <src_dir>clang-tools-extra/docs/clang-tidy/checks > clangtidy_new.xml581#
582# 3. compare the new version with the old one, extend the old XML
583# python utils_createrules.py comparerules clangtidy.xml clangtidy_new.xml
389 rules.append(rule)
390
391def create_clang_default_rules(rules):
392 # defaults clang error (not associated with any activation switch): error, fatal error393 rule_key = "clang-diagnostic-error"
394 rule_name = "clang-diagnostic-error"
395 rule_type = DIAG_CLASS["CLASS_ERROR"]["sonarqube_type"]
Docstring line lengths are recommended to be no greater than 79 characters.