123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- default_install_hook_types: ['pre-commit', 'pre-push']
- exclude: >
- (?x)(
- LICENSE$|
- \.snap$|
- \.map$|
- \.map\.js$|
- ^src/sentry/static/sentry/vendor/|
- ^src/.*/locale/|
- ^src/sentry/data/
- )
- repos:
- # Many of these hooks are local because people use a variety of IDEs
- # with autoformatters that need to call out to things like `black` directly.
- # pre-commit run is not the same, and something like pre-commit exec does
- # not exist yet.
- - repo: local
- hooks:
- - id: pyupgrade
- name: pyupgrade
- entry: pyupgrade
- args: ['--py38-plus', '--keep-runtime-typing']
- language: system
- types: [python]
- # Configuration for black exists in pyproject.toml,
- # but we let pre-commit take care of the file filtering.
- - id: black
- name: black
- entry: black
- language: system
- types: [python]
- require_serial: true
- # Configuration for isort exists in pyproject.toml,
- # but we let pre-commit take care of the file filtering.
- - id: isort
- name: isort
- entry: isort
- language: system
- types: [python]
- # Configuration for flake8 exists in setup.cfg,
- # but we let pre-commit take care of the file filtering.
- - id: flake8
- name: flake8
- entry: flake8
- language: system
- types: [python]
- log_file: '.artifacts/flake8.pycodestyle.log'
- - id: lint-requirements
- name: lint-requirements
- entry: python -m tools.lint_requirements
- language: python
- files: requirements-.*\.txt$
- additional_dependencies: [packaging==21.3]
- - id: check-mypy-bypass
- name: do not bypass the type checker
- entry: '(^# *mypy: *ignore-errors|^# *type: *ignore|\bno_type_check\b)'
- language: pygrep
- types: [python]
- exclude: ^src/sentry/metrics/minimetrics.py$
- - id: prevent-push
- name: prevent pushing master
- stages: [pre-push]
- entry: bash -c 'test "$PRE_COMMIT_REMOTE_BRANCH" != "refs/heads/master"'
- always_run: true
- pass_filenames: false
- language: system
- - repo: https://github.com/pre-commit/pygrep-hooks
- rev: v1.10.0
- hooks:
- - id: python-use-type-annotations
- - repo: https://github.com/python-jsonschema/check-jsonschema
- rev: 0.24.1
- hooks:
- - id: check-github-actions
- - id: check-github-workflows
- args: [--verbose]
- - repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.3.0
- hooks:
- - id: check-case-conflict
- - id: check-executables-have-shebangs
- - id: check-merge-conflict
- - id: check-symlinks
- - id: check-yaml
- - id: end-of-file-fixer
- exclude_types: [svg]
- exclude: ^fixtures/
- - id: trailing-whitespace
- exclude_types: [svg]
- exclude: ^(fixtures/|scripts/patches/)
- - id: debug-statements
- - id: name-tests-test
- args: [--pytest-test-first]
- - repo: https://github.com/pre-commit/mirrors-prettier
- rev: 'v3.0.3' # Use the sha or tag you want to point at
- hooks:
- - id: prettier
- # TODO: figure out how to un-exclude templates
- # can't parse successfully as html:
- #exclude: (^|/)fixtures/|src/sentry/templates/sentry/layout.html|src/sentry/templates/sentry/login.html|src/sentry/templates/sentry/emails/transfer_project.html|src/sentry/auth/providers/saml2/generic/templates/sentry_auth_saml2/select-idp.html|src/sentry/templates/sentry/auth-link-identity.html|src/sentry/templates/sentry/auth-link-login.html|src/sentry/templates/sentry/auth-link-login.html|src/sentry/templates/sentry/auth-unlink-identity.html|src/sentry/templates/sentry/auth-unlink-identity.html|src/sentry/templates/sentry/emails/org_delete_confirm.html|src/sentry/templates/sentry/emails/requests/organization-integration.html|src/sentry/templates/sentry/emails/transfer_project.html|src/sentry/templates/sentry/error-page-embed.html|src/sentry/templates/sentry/integrations/gitlab-config.html|src/sentry/templates/sentry/integrations/notify-disable.html|src/sentry/templates/sentry/integrations/sentry-app-notify-disable.html|src/sentry/templates/sentry/integrations/slack/link-team.html|src/sentry/templates/sentry/integrations/slack/unlink-team.html|src/sentry/templates/sentry/layout.html|src/sentry/templates/sentry/login.html|src/sentry/templates/sentry/login.html|src/sentry/templates/sentry/organization-login.html|src/sentry/templates/sentry/partial/system-status.html|src/sentry/templates/sentry/plugins/bases/issue/create_issue.html
- # can't parse successfully as jinja+html:
- exclude: (^|/)fixtures/|src/sentry/templates/sentry/500.html|src/sentry/templates/sentry/account/sudo.html|src/sentry/templates/sentry/bases/react_pipeline.html|src/sentry/templates/sentry/debug/error-page-embed.html|src/sentry/templates/sentry/emails/error.html|src/sentry/templates/sentry/emails/org_delete_confirm.html|src/sentry/templates/sentry/emails/reports/body.html|src/sentry/templates/sentry/emails/transfer_project.html|src/sentry/templates/sentry/error-page-embed.html|src/sentry/templates/sentry/error-page-embed.html|src/sentry/templates/sentry/integrations/dialog-complete.html|src/sentry/templates/sentry/integrations/github-integration-exists-on-another-org.html|src/sentry/templates/sentry/integrations/integration-pending-deletion.html|src/sentry/templates/sentry/integrations/jira-config.html|src/sentry/templates/sentry/integrations/notify-disable.html|src/sentry/templates/sentry/integrations/sentry-app-notify-disable.html|src/sentry/templates/sentry/integrations/slack/link-team-error.html|src/sentry/templates/sentry/layout.html|src/sentry/templates/sentry/login.html|src/sentry/templates/sentry/oauth-error.html|src/sentry/templates/sentry/organization-login.html|src/sentry/templates/sentry/partial/system-status.html|src/sentry/templates/sentry/pipeline-error.html|src/sentry/templates/sentry/pipeline-provider-error.html|src/sentry/templates/sentry/setup-wizard.html|src/sentry/templates/sentry/twofactor_u2f.html|src/sentry/replays/blueprints/api.md|static/app/views/replays/detail/layout/splitPanel.tsx
|