.pre-commit-config.yaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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']
  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. # Temporarily disable pyright checking until we clean up unbound variable errors across
  60. # the codebase
  61. # - id: pyright
  62. # name: pyright
  63. # entry: pyright
  64. # language: node
  65. # types: [ python ]
  66. # pass_filenames: true
  67. # additional_dependencies: [ "pyright@1.1.178" ]
  68. - repo: https://github.com/sirosen/check-jsonschema
  69. rev: 0.3.0
  70. hooks:
  71. - id: check-github-actions
  72. - id: check-github-workflows
  73. - repo: https://github.com/pre-commit/pre-commit-hooks
  74. rev: v4.0.1
  75. hooks:
  76. - id: check-case-conflict
  77. - id: check-executables-have-shebangs
  78. - id: check-merge-conflict
  79. - id: check-symlinks
  80. - id: end-of-file-fixer
  81. exclude_types: [svg]
  82. - id: trailing-whitespace
  83. exclude_types: [svg]
  84. - id: debug-statements