Ver Fonte

Move mypy config to setup.cfg (#1239)

Jon Meow há 4 anos atrás
pai
commit
24bea76c3e
2 ficheiros alterados com 9 adições e 12 exclusões
  1. 2 12
      .pre-commit-config.yaml
  2. 7 0
      setup.cfg

+ 2 - 12
.pre-commit-config.yaml

@@ -89,19 +89,9 @@ repos:
     rev: 'v0.950'
     hooks:
       - id: mypy
+        # Use setup.cfg to match the command line.
         args:
-          - --disallow-untyped-decorators
-          - --warn-unused-configs
-          - --disallow-subclassing-any
-          - --disallow-untyped-calls
-          - --disallow-untyped-defs
-          - --disallow-incomplete-defs
-          - --check-untyped-defs
-          - --no-implicit-optional
-          - --warn-redundant-casts
-          - --warn-unused-ignores
-          - --warn-return-any
-          - --pretty
+          - --config-file=setup.cfg
         # This should match the requirements added in the WORKSPACE pip_install.
         additional_dependencies:
           - gql >= 2.0.0, < 3.0.0

+ 7 - 0
setup.cfg

@@ -6,3 +6,10 @@
 max-line-length = 80
 # E203: This warning is not PEP 8 compliant.
 extend-ignore = E203
+
+[mypy]
+pretty = True
+# Define flags relative to strict mode.
+strict = True
+# TODO: Look at updating code to fix these.
+disallow_any_generics = False