Publicado em: 13/Jan/2020
Atualizado em: 22/Jun/2020
#C++ #cpp #clang-tidy

Otimizando código com clang-tidy

Instalação

1apt-get install clang-tidy

Verificadores disponíveis

 1clang-tidy --list-checks -checks='*' | grep "modernize"
 2    modernize-avoid-bind
 3    modernize-deprecated-headers
 4    modernize-loop-convert
 5    modernize-make-shared
 6    modernize-make-unique
 7    modernize-pass-by-value
 8    modernize-raw-string-literal
 9    modernize-redundant-void-arg
10    modernize-replace-auto-ptr
11    modernize-replace-random-shuffle
12    modernize-return-braced-init-list
13    modernize-shrink-to-fit
14    modernize-unary-static-assert
15    modernize-use-auto
16    modernize-use-bool-literals
17    modernize-use-default-member-init
18    modernize-use-emplace
19    modernize-use-equals-default
20    modernize-use-equals-delete
21    modernize-use-noexcept
22    modernize-use-nullptr
23    modernize-use-override
24    modernize-use-transparent-functors
25    modernize-use-uncaught-exceptions
26    modernize-use-using

Uso

1clang-tidy -checks='modernize-use-override' -fix test.cpp -- -std=c++11

Referências

comments powered by Disqus