.pre-commit-config.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. # For some tools, we install them locally (in the virtualenv).
  16. # This makes it easier to use them directly (as opposed to pre-commit run),
  17. # and it's also faster as pre-commit doesn't have to manage them.
  18. # The thing we lose here is autoupdate, but we have git hooks that
  19. # let you know when requirements-pre-commit.txt changes.
  20. - repo: local
  21. hooks:
  22. - id: pyupgrade
  23. name: pyupgrade
  24. entry: pyupgrade
  25. args: ['--py38-plus', '--keep-runtime-typing']
  26. language: system
  27. types: [python]
  28. # Configuration for black exists in pyproject.toml,
  29. # but we let pre-commit take care of the file filtering.
  30. - id: black
  31. name: black
  32. entry: black
  33. language: system
  34. types: [python]
  35. require_serial: true
  36. # Configuration for isort exists in pyproject.toml,
  37. # but we let pre-commit take care of the file filtering.
  38. - id: isort
  39. name: isort
  40. entry: isort
  41. language: system
  42. types: [python]
  43. # Configuration for flake8 exists in setup.cfg,
  44. # but we let pre-commit take care of the file filtering.
  45. - id: flake8
  46. name: flake8
  47. entry: flake8
  48. language: system
  49. types: [python]
  50. log_file: '.artifacts/flake8.pycodestyle.log'
  51. - id: lint-requirements
  52. name: lint-requirements
  53. entry: bin/lint-requirements
  54. language: python
  55. files: requirements-base.txt
  56. pass_filenames: false
  57. additional_dependencies: [packaging==21.3]
  58. - id: pyright
  59. name: pyright
  60. entry: pyright
  61. language: node
  62. types: [ python ]
  63. pass_filenames: 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. - id: debug-statements