.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. ^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: bin/lint-requirements
  51. language: python
  52. files: requirements-base.txt
  53. pass_filenames: false
  54. additional_dependencies: [packaging==21.3]
  55. - id: pyright
  56. name: pyright
  57. entry: pyright
  58. language: node
  59. files: ^src/
  60. types: [ python ]
  61. require_serial: true
  62. additional_dependencies: [ "pyright@1.1.186" ]
  63. args: [ '--project', 'pyrightconfig-commithook.json' ]
  64. - repo: https://github.com/python-jsonschema/check-jsonschema
  65. rev: 0.16.0
  66. hooks:
  67. - id: check-github-actions
  68. - id: check-github-workflows
  69. - repo: https://github.com/pre-commit/pre-commit-hooks
  70. rev: v4.3.0
  71. hooks:
  72. - id: check-case-conflict
  73. - id: check-executables-have-shebangs
  74. - id: check-merge-conflict
  75. - id: check-symlinks
  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]