.pre-commit-config.yaml 2.3 KB

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