.pre-commit-config.yaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. - repo: https://github.com/python-jsonschema/check-jsonschema
  54. rev: 0.24.1
  55. hooks:
  56. - id: check-github-actions
  57. - id: check-github-workflows
  58. args: [--verbose]
  59. - repo: https://github.com/pre-commit/pre-commit-hooks
  60. rev: v4.3.0
  61. hooks:
  62. - id: check-case-conflict
  63. - id: check-executables-have-shebangs
  64. - id: check-merge-conflict
  65. - id: check-symlinks
  66. - id: check-yaml
  67. - id: end-of-file-fixer
  68. exclude_types: [svg]
  69. exclude: ^fixtures/
  70. - id: trailing-whitespace
  71. exclude_types: [svg]
  72. exclude: ^(fixtures/|scripts/patches/)
  73. - id: debug-statements
  74. - id: name-tests-test
  75. args: [--pytest-test-first]