Kubernetes manifest linter using JSON Schema
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
2.5KB

  1. ---
  2. minimum_pre_commit_version: 1.21.0
  3. fail_fast: false
  4. default_stages: [commit, push]
  5. repos:
  6. # meta
  7. - repo: meta
  8. hooks:
  9. - id: check-hooks-apply
  10. - id: check-useless-excludes
  11. # formatters
  12. - repo: https://github.com/asottile/reorder_python_imports
  13. rev: v1.9.0
  14. hooks:
  15. - id: reorder-python-imports
  16. - repo: https://github.com/ambv/black
  17. rev: 19.10b0
  18. hooks:
  19. - id: black
  20. - repo: https://github.com/asottile/pyupgrade
  21. rev: v1.26.0
  22. hooks:
  23. - id: pyupgrade
  24. stages: [push]
  25. # linters
  26. - repo: https://github.com/PyCQA/bandit
  27. rev: 1.6.2
  28. hooks:
  29. - id: bandit
  30. args: ["-x", "tests"]
  31. stages: [push]
  32. #- repo: https://github.com/PyCQA/pydocstyle
  33. #rev: 5.0.2
  34. #hooks:
  35. #- id: pydocstyle
  36. #args: ["--ignore=D10,D21,D202"]
  37. - repo: local
  38. hooks:
  39. - id: safety
  40. name: safety
  41. entry: safety
  42. language: system
  43. pass_filenames: false
  44. args: ["check", "--bare"]
  45. stages: [push]
  46. - id: poetry
  47. name: poetry
  48. description: Validates the structure of the pyproject.toml file
  49. entry: poetry check
  50. language: system
  51. pass_filenames: false
  52. files: ^pyproject.toml$
  53. stages: [push]
  54. - repo: https://github.com/adrienverge/yamllint
  55. rev: v1.20.0
  56. hooks:
  57. - id: yamllint
  58. args: ["--strict", "-d", "{rules: {line-length: {max: 180}}}"]
  59. - repo: https://github.com/pre-commit/mirrors-mypy
  60. rev: v0.761
  61. hooks:
  62. - id: mypy
  63. # miscellaneous
  64. - repo: https://github.com/pre-commit/pre-commit-hooks
  65. rev: v2.4.0
  66. hooks:
  67. - id: check-docstring-first
  68. - id: debug-statements
  69. - id: end-of-file-fixer
  70. - id: flake8
  71. additional_dependencies: ["flake8-bugbear"]
  72. - id: trailing-whitespace
  73. - id: check-ast
  74. - id: check-builtin-literals
  75. - id: detect-private-key
  76. - id: mixed-line-ending
  77. - id: name-tests-test
  78. args: ["--django"]
  79. - repo: https://github.com/pre-commit/pygrep-hooks
  80. rev: v1.4.4
  81. hooks:
  82. # - id: rst-backticks
  83. - id: python-use-type-annotations
  84. - id: python-no-log-warn
  85. - id: python-no-eval
  86. - id: python-check-mock-methods
  87. - id: python-check-blanket-noqa
  88. # commit-msg
  89. # http://jorisroovers.com/gitlint/#using-gitlint-through-pre-commit
  90. - repo: https://github.com/jorisroovers/gitlint
  91. rev: v0.12.0
  92. hooks:
  93. - id: gitlint