.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. ^tests/sentry/lang/javascript/example-project/|
  9. ^src/.*/locale/|
  10. ^src/sentry/data/
  11. )
  12. repos:
  13. # Many of these hooks are local because people use a variety of IDEs
  14. # with autoformatters that need to call out to things like `black` directly.
  15. # pre-commit run is not the same, and something like pre-commit exec does
  16. # not exist yet.
  17. - repo: local
  18. hooks:
  19. - id: pyupgrade
  20. name: pyupgrade
  21. entry: pyupgrade
  22. args: ['--py38-plus', '--keep-runtime-typing']
  23. language: system
  24. types: [python]
  25. # Configuration for black exists in pyproject.toml,
  26. # but we let pre-commit take care of the file filtering.
  27. - id: black
  28. name: black
  29. entry: black
  30. language: system
  31. types: [python]
  32. require_serial: true
  33. # Configuration for isort exists in pyproject.toml,
  34. # but we let pre-commit take care of the file filtering.
  35. - id: isort
  36. name: isort
  37. entry: isort
  38. language: system
  39. types: [python]
  40. # Configuration for flake8 exists in setup.cfg,
  41. # but we let pre-commit take care of the file filtering.
  42. - id: flake8
  43. name: flake8
  44. entry: flake8
  45. language: system
  46. types: [python]
  47. log_file: '.artifacts/flake8.pycodestyle.log'
  48. - id: lint-requirements
  49. name: lint-requirements
  50. entry: python -m tools.lint_requirements
  51. language: system
  52. files: requirements-frozen.txt
  53. pass_filenames: false
  54. - id: pyright
  55. name: pyright
  56. entry: pyright
  57. language: node
  58. files: ^src/
  59. types: [ python ]
  60. require_serial: true
  61. additional_dependencies: [ "pyright@1.1.186" ]
  62. args: [ '--project', 'pyrightconfig-commithook.json' ]
  63. - repo: https://github.com/python-jsonschema/check-jsonschema
  64. rev: 0.16.0
  65. hooks:
  66. - id: check-github-actions
  67. - id: check-github-workflows
  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]