.pre-commit-config.yaml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.186" ]
  61. args: [ '--project', '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: end-of-file-fixer
  76. exclude_types: [svg]
  77. exclude: ^fixtures/
  78. - id: trailing-whitespace
  79. exclude_types: [svg]
  80. exclude: ^(fixtures/|scripts/patches/)
  81. - id: debug-statements
  82. - id: name-tests-test
  83. args: [--pytest-test-first]