@@ -31,34 +31,52 @@ repos:
3131 - id : trailing-whitespace
3232
3333 # Python hooks
34- - repo : https://github.com/pycqa/isort
35- rev : 5.8.0
34+ # PEP 257
35+ - repo : https://github.com/FalconSocial/pre-commit-mirrors-pep257
36+ rev : v0.3.3
3637 hooks :
37- - id : isort
38+ - id : pep257
39+ args : ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]
3840
39- # - repo: local
40- # hooks:
41- # - id: ament_pep257
42- # name: ament_pep257
43- # description: Find warnings/errors in ROS Python code.
44- # entry: ament_pep257
45- # language: python
41+ - repo : https://github.com/pycqa/flake8
42+ rev : 3.9.0
43+ hooks :
44+ - id : flake8
45+ args : ["--ignore=E501"]
4646
4747 - repo : https://github.com/psf/black
4848 rev : 20.8b1
4949 hooks :
5050 - id : black
51- args : [--line-length=100]
51+ args : ["--line-length=100"]
52+
53+ # CPP hooks
54+ # The same options as in ament_cppcheck are used, but its not working...
55+ # - repo: https://github.com/pocc/pre-commit-hooks
56+ # rev: v1.1.1
57+ # hooks:
58+ # - id: cppcheck
59+ # args: ['--error-exitcode=1', '-f', '--inline-suppr', '-q', '-rp', '--suppress=internalAstError', '--suppress=unknownMacro', '--verbose']
5260
53- # Cpp hooks
5461 - repo : local
5562 hooks :
5663 - id : ament_cppcheck
5764 name : ament_cppcheck
58- description : Find warnings/errors in ROS C/CPP code .
65+ description : Static code analysis of C/C++ files .
5966 entry : ament_cppcheck
60- language : python
61- files : \.(c|cc|cxx|cpp|h|hpp|hxx|m)$
67+ language : system
68+ files : \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
69+
70+ # Maybe use https://github.com/cpplint/cpplint instead
71+ - repo : local
72+ hooks :
73+ - id : ament_cpplint
74+ name : ament_cpplint
75+ description : Static code analysis of C/C++ files.
76+ entry : ament_cpplint
77+ language : system
78+ files : \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
79+ args : ["--linelength=120"]
6280
6381 - repo : local
6482 hooks :
@@ -70,15 +88,44 @@ repos:
7088 files : \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
7189 args : ['-fallback-style=none', '-i']
7290
91+ # Cmake hooks
92+ - repo : local
93+ hooks :
94+ - id : ament_lint_cmake
95+ name : ament_lint_cmake
96+ description : Check format of CMakeLists.txt files.
97+ entry : ament_lint_cmake
98+ language : system
99+ files : CMakeLists.txt$
100+
101+ # Copyright
102+ - repo : local
103+ hooks :
104+ - id : ament_copyright
105+ name : ament_copyright
106+ description : Check if copyright notice is available in all files.
107+ entry : ament_copyright
108+ language : system
109+
73110 # Docs - RestructuredText hooks
74111 - repo : https://github.com/PyCQA/doc8
75112 rev : 0.9.0a1
76113 hooks :
77114 - id : doc8
78115 args : ['--max-line-length=100', '--ignore=D001']
79116
80- # - repo: https://github.com/codespell-project/codespell
81- # rev: v2.0.0
82- # hooks:
83- # - id: codespell
84- # args: ['--write-changes', '--skip="*.svg"']
117+ - repo : https://github.com/pre-commit/pygrep-hooks
118+ rev : v1.8.0
119+ hooks :
120+ - id : rst-backticks
121+ - id : rst-directive-colons
122+ - id : rst-inline-touching-normal
123+
124+ # Spellcheck in comments and docs
125+ # skipping of *.svg files is not working...
126+ - repo : https://github.com/codespell-project/codespell
127+ rev : v2.0.0
128+ hooks :
129+ - id : codespell
130+ args : ['--write-changes']
131+ exclude : \.(svg|pyc)$
0 commit comments