.pre-commit-config.yaml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # See https://pre-commit.com for more information
  2. # See https://pre-commit.com/hooks.html for more hooks
  3. repos:
  4. - repo: https://github.com/pre-commit/pre-commit-hooks
  5. rev: v3.4.0
  6. hooks:
  7. - id: trailing-whitespace
  8. # note: whitespace exclusions use multiline regex, see https://pre-commit.com/#regular-expressions
  9. # items are:
  10. # 1 - some file extensions
  11. # 2 - any file matching *test*/*expected* (for host tests, if possible use this naming pattern always)
  12. # 3 - any directory named 'testdata'
  13. # 4 - IDF monitor test data
  14. exclude: &whitespace_excludes |
  15. (?x)^(
  16. .+\.(md|rst|map|bin)|
  17. .+test.*\/.*expected.*|
  18. .+\/testdata\/.+|
  19. .+test_idf_monitor\/tests\/.+
  20. )$
  21. - id: end-of-file-fixer
  22. exclude: *whitespace_excludes
  23. - id: check-executables-have-shebangs
  24. - id: file-contents-sorter
  25. files: 'tools/ci/executable-list.txt'
  26. - id: mixed-line-ending
  27. args: ['-f=lf']
  28. - id: double-quote-string-fixer
  29. - repo: https://gitlab.com/pycqa/flake8
  30. rev: 3.8.4
  31. hooks:
  32. - id: flake8
  33. args: ['--config=.flake8', '--tee', '--benchmark']
  34. - repo: https://github.com/pycqa/isort
  35. rev: 5.6.4
  36. hooks:
  37. - id: isort
  38. name: isort (python)
  39. - repo: local
  40. hooks:
  41. - id: check-executables
  42. name: Check File Permissions
  43. entry: tools/ci/check_executables.py --action executables
  44. language: python
  45. types: [executable]
  46. exclude: '\.pre-commit/.+'
  47. - id: check-executable-list
  48. name: Validate executable-list.txt
  49. entry: tools/ci/check_executables.py --action list
  50. language: python
  51. pass_filenames: false
  52. always_run: true
  53. - id: check-kconfigs
  54. name: Validate Kconfig files
  55. entry: tools/ci/check_kconfigs.py
  56. language: python
  57. files: '^Kconfig$|Kconfig.*$'
  58. - id: check-deprecated-kconfigs-options
  59. name: Check if any Kconfig Options Deprecated
  60. entry: tools/ci/check_deprecated_kconfigs.py
  61. language: python
  62. files: 'sdkconfig\.ci$|sdkconfig\.rename$|sdkconfig.*$'
  63. - id: cmake-lint
  64. name: Check CMake Files Format
  65. entry: cmakelint --linelength=120 --spaces=4 --filter=-whitespace/indent
  66. language: python
  67. additional_dependencies:
  68. - cmakelint==1.4.1
  69. files: 'CMakeLists.txt$|\.cmake$'
  70. exclude: '\/third_party\/'
  71. - id: check-codeowners
  72. name: Validate Codeowner File
  73. entry: tools/ci/check_codeowners.py ci-check
  74. language: python
  75. files: '\.gitlab/CODEOWNERS'
  76. pass_filenames: false