.pre-commit-config.yaml 2.4 KB

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