@@ -36,22 +36,29 @@ repos:
3636 language : system
3737 # <---- Local Hooks ------------------------------------------------------------------------------------------------
3838
39+ # ----- Remove Typing - Py3.5 Support ---------------------------------------------------------------------------->
40+ - repo : https://github.com/s0undt3ch/downgrade-source
41+ rev : v2.1.0
42+ hooks :
43+ - id : downgrade-source
44+ name : Downgrade source code into a separate package to support Py3.5
45+ files : ^src/.*\.py$
46+ exclude : ^src/pytestskipmarkers/((__init__|version|utils/__init__)\.py|downgraded/.*\.py)$
47+ args :
48+ - --target-version=3.5
49+ - --pkg-path=src/pytestskipmarkers
50+ - --skip-checker=nounusableimports
51+ - --skip-checker=nostarimports
52+ # <---- Remove Typing - Py3.5 Support -----------------------------------------------------------------------------
53+
3954 # ----- Formatting ------------------------------------------------------------------------------------------------>
4055 - repo : https://github.com/asottile/pyupgrade
4156 rev : v2.29.0
4257 hooks :
4358 - id : pyupgrade
4459 name : Rewrite Code to be Py3.5+
4560 args : [--py3-plus]
46- exclude : (^src/pytestskipmarkers/utils/saltext/.*\.py)
47-
48- - repo : https://github.com/hakancelik96/unimport
49- rev : " 0.9.2"
50- hooks :
51- - id : unimport
52- name : Remove unused imports
53- args : [--remove]
54- exclude : ^(docs/.*\.py|src/pytestskipmarkers/(cli|daemons)/__init__\.py)$
61+ exclude : ^src/pytestskipmarkers/downgraded/.*\.py$
5562
5663 - repo : https://github.com/asottile/reorder_python_imports
5764 rev : v2.6.0
@@ -61,42 +68,22 @@ repos:
6168 --py3-plus,
6269 --application-directories=.:src:examples/echo-extension/src
6370 ]
64- exclude : src/pytestskipmarkers/version.py
71+ exclude : ^ src/pytestskipmarkers/( version.py|downgraded/.*)$
6572
6673 - repo : https://github.com/psf/black
6774 rev : 21.9b0
6875 hooks :
6976 - id : black
7077 args : [-l 100]
71- exclude : src/pytestskipmarkers/version.py
78+ exclude : ^ src/pytestskipmarkers/( version.py|downgraded/.*)$
7279
7380 - repo : https://github.com/asottile/blacken-docs
7481 rev : v1.11.0
7582 hooks :
7683 - id : blacken-docs
7784 args : [--skip-errors]
78- files : ^(docs/.*\.rst|src/pytestskipmarkers/.*\.py)$
85+ files : ^(.*\.rst| docs/.*\.rst|src/pytestskipmarkers/.*\.py)$
7986 additional_dependencies : [black==21.9b0]
80-
81- - repo : https://github.com/pre-commit/mirrors-pylint
82- rev : v3.0.0a4
83- hooks :
84- - id : pylint
85- name : PyLint
86- args : [--output-format=parseable, --rcfile=.pylintrc]
87- exclude : src/pytestskipmarkers/version.py
88- additional_dependencies :
89- - pyenchant
90-
91- - repo : https://github.com/pre-commit/mirrors-mypy
92- rev : v0.910
93- hooks :
94- - id : mypy
95- files : ^(src/|tests/).*\.py$
96- args : []
97- additional_dependencies :
98- - types-attrs
99- - types-setuptools
10087 # <---- Formatting -------------------------------------------------------------------------------------------------
10188
10289 # ----- Security -------------------------------------------------------------------------------------------------->
@@ -120,3 +107,42 @@ repos:
120107 args : [--silent, -lll, --skip, B701]
121108 files : ^tests/.*
122109 # <---- Security ---------------------------------------------------------------------------------------------------
110+
111+ # ----- Code Analysis --------------------------------------------------------------------------------------------->
112+ - repo : https://github.com/pycqa/flake8
113+ rev : ' 4.0.1'
114+ hooks :
115+ - id : flake8
116+ exclude : ^(src/pytestskipmarkers/(downgraded/.*|version\.py)|\.pre-commit-hooks/.*\.py)$
117+ additional_dependencies :
118+ - flake8-mypy-fork
119+ - flake8-docstrings
120+ - flake8-typing-imports
121+
122+ - repo : https://github.com/pre-commit/mirrors-mypy
123+ rev : v0.931
124+ hooks :
125+ - id : mypy
126+ name : Run mypy against source
127+ files : ^src/.*\.py$
128+ exclude : ^src/pytestskipmarkers/(downgraded/.*|utils/(socket|time)\.py)$
129+ args : [--strict]
130+ additional_dependencies :
131+ - attrs
132+ - types-attrs
133+ - types-setuptools
134+
135+ - repo : https://github.com/pre-commit/mirrors-mypy
136+ rev : v0.931
137+ hooks :
138+ - id : mypy
139+ name : Run mypy against tests
140+ files : ^tests/.*\.py$
141+ exclude : ^src/pytestskipmarkers/(downgraded/.*|utils/(socket|time)\.py)$
142+ args : []
143+ additional_dependencies :
144+ - pytest
145+ - attrs
146+ - types-attrs
147+ - types-setuptools
148+ # <---- Code Analysis ----------------------------------------------------------------------------------------------
0 commit comments