.pre-commit-config.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. exclude: >
  2. (?x)(
  3. LICENSE$|
  4. \.snap$|
  5. \.map$|
  6. \.map\.js$|
  7. ^src/sentry/static/sentry/vendor/|
  8. ^src/.*/locale/|
  9. ^src/sentry/data/
  10. )
  11. repos:
  12. # Many of these hooks are local because people use a variety of IDEs
  13. # with autoformatters that need to call out to things like `black` directly.
  14. # pre-commit run is not the same, and something like pre-commit exec does
  15. # not exist yet.
  16. - repo: local
  17. hooks:
  18. - id: pyupgrade
  19. name: pyupgrade
  20. entry: pyupgrade
  21. args: ['--py38-plus', '--keep-runtime-typing']
  22. language: system
  23. types: [python]
  24. # Configuration for black exists in pyproject.toml,
  25. # but we let pre-commit take care of the file filtering.
  26. - id: black
  27. name: black
  28. entry: black
  29. language: system
  30. types: [python]
  31. require_serial: true
  32. # Configuration for isort exists in pyproject.toml,
  33. # but we let pre-commit take care of the file filtering.
  34. - id: isort
  35. name: isort
  36. entry: isort
  37. language: system
  38. types: [python]
  39. # Configuration for flake8 exists in setup.cfg,
  40. # but we let pre-commit take care of the file filtering.
  41. - id: flake8
  42. name: flake8
  43. entry: flake8
  44. language: system
  45. types: [python]
  46. log_file: '.artifacts/flake8.pycodestyle.log'
  47. - id: lint-requirements
  48. name: lint-requirements
  49. entry: python -m tools.lint_requirements
  50. language: python
  51. files: requirements-.*\.txt$
  52. additional_dependencies: [packaging==21.3]
  53. - id: pyright
  54. name: pyright
  55. entry: pyright
  56. language: node
  57. files: ^src/
  58. types: [ python ]
  59. require_serial: true
  60. additional_dependencies: [ "pyright@1.1.311" ]
  61. args: [ '--project', 'config/pyrightconfig-commithook.json' ]
  62. - repo: https://github.com/python-jsonschema/check-jsonschema
  63. rev: 0.21.0
  64. hooks:
  65. - id: check-github-actions
  66. - id: check-github-workflows
  67. args: [--verbose]
  68. - repo: https://github.com/pre-commit/pre-commit-hooks
  69. rev: v4.3.0
  70. hooks:
  71. - id: check-case-conflict
  72. - id: check-executables-have-shebangs
  73. - id: check-merge-conflict
  74. - id: check-symlinks
  75. - id: check-yaml
  76. - id: end-of-file-fixer
  77. exclude_types: [svg]
  78. exclude: ^fixtures/
  79. - id: trailing-whitespace
  80. exclude_types: [svg]
  81. exclude: ^(fixtures/|scripts/patches/)
  82. - id: debug-statements
  83. - id: name-tests-test
  84. args: [--pytest-test-first]