Browse Source

ref: add lint to prevent bypassing linting (#56964)

herding cats
anthony sottile 1 year ago
parent
commit
bf26c3bdc7
2 changed files with 6 additions and 1 deletions
  1. 6 0
      .pre-commit-config.yaml
  2. 0 1
      src/sentry/integrations/opsgenie/__init__.py

+ 6 - 0
.pre-commit-config.yaml

@@ -51,6 +51,12 @@ repos:
       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$
 
 -   repo: https://github.com/python-jsonschema/check-jsonschema
     rev: 0.24.1

+ 0 - 1
src/sentry/integrations/opsgenie/__init__.py

@@ -1,4 +1,3 @@
-# mypy: ignore-errors
 from sentry.rules import rules
 
 from .actions import OpsgenieNotifyTeamAction