.pre-commit-config.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. # Configuration for black exists in pyproject.toml,
  23. # but we let pre-commit take care of the file filtering.
  24. - id: black
  25. name: black
  26. entry: black
  27. language: system
  28. types: [python]
  29. # Configuration for isort exists in pyproject.toml,
  30. # but we let pre-commit take care of the file filtering.
  31. - id: isort
  32. name: isort
  33. entry: isort
  34. language: system
  35. types: [python]
  36. # Configuration for flake8 exists in setup.cfg,
  37. # but we let pre-commit take care of the file filtering.
  38. - id: flake8
  39. name: flake8
  40. entry: flake8
  41. language: system
  42. types: [python]
  43. log_file: '.artifacts/flake8.pycodestyle.log'
  44. - id: pyupgrade
  45. name: pyupgrade
  46. entry: pyupgrade
  47. args: ['--py36-plus']
  48. language: system
  49. types: [python]
  50. # We can't change this mock to unittest.mock until Python 3.8,
  51. # refer to the comment in this file.
  52. exclude: 'src/sentry/utils/compat/mock.py'
  53. - repo: https://github.com/sirosen/check-jsonschema
  54. rev: 0.3.0
  55. hooks:
  56. - id: check-github-actions
  57. - id: check-github-workflows
  58. - repo: https://github.com/pre-commit/pre-commit-hooks
  59. rev: v3.4.0
  60. hooks:
  61. - id: check-case-conflict
  62. - id: check-executables-have-shebangs
  63. - id: check-merge-conflict
  64. - id: check-symlinks
  65. - id: end-of-file-fixer
  66. exclude_types: [svg]
  67. - id: trailing-whitespace
  68. exclude_types: [svg]
  69. - id: debug-statements