File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,14 +52,20 @@ ifneq ($(MIG_ENV),'local')
5252 @echo "unavailable outside local development environment"
5353 @exit 1
5454endif
55+ @make style-check-python
5556 @make lint-python
5657
5758# NOTE: black and isort use pyproject.toml to temporarily exclude a few paths
58- .PHONY : lint -python
59- lint -python :
59+ .PHONY : style-check -python
60+ style-check -python :
6061 @$(LOCAL_PYTHON_BIN ) -m black $(LINT_ENFORCE_DIRS ) --check
6162 @$(LOCAL_PYTHON_BIN ) -m isort $(LINT_ENFORCE_DIRS ) --check-only
6263
64+ .PHONY : lint-python
65+ lint-python :
66+ @$(LOCAL_PYTHON_BIN ) -m pylint $(LINT_ENFORCE_DIRS ) --errors-only
67+ @$(LOCAL_PYTHON_BIN ) -m ruff check $(LINT_ENFORCE_DIRS )
68+
6369.PHONY : clean
6470clean :
6571 @rm -f ./envhelp/py3.imageid
Original file line number Diff line number Diff line change 55autopep8;python_version >= "3"
66black
77isort
8+ pylint
9+ ruff
810# We need paramiko for the ssh unit tests
911# NOTE: paramiko-3.0.0 dropped python2 and python3.6 support
1012paramiko;python_version >= "3.7"
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ extend-exclude = '''
2323[tool .isort ]
2424profile = " black"
2525line_length = 80
26+ skip_glob = [" .git/*" , " tests/data/*" , " tests/fixture/*" ]
2627# NOTE: the following paths must be kept in sync with black extend-exclude
2728skip = [
2829 " bin/checkconf.py" ,
@@ -33,4 +34,34 @@ skip = [
3334 " sbin/grid_sftp.py" ,
3435 " sbin/grid_webdavs.py"
3536]
36- skip_glob = [" .git/*" , " tests/data/*" , " tests/fixture/*" ]
37+
38+ [tool .pylint ]
39+ max-line-length = 80
40+ ignore-pattern = '''
41+ tests/data/
42+ | tests/fixture/
43+ '''
44+ # NOTE: the following paths must be kept in sync with black extend-exclude
45+ ignore-paths = [
46+ " bin/checkconf.py" ,
47+ " bin/createresource.py" ,
48+ " bin/notifypassword.py" ,
49+ " sbin/grid_ftps.py" ,
50+ " sbin/grid_openid.py" ,
51+ " sbin/grid_sftp.py" ,
52+ " sbin/grid_webdavs.py"
53+ ]
54+
55+ [tool .ruff ]
56+ line-length = 80
57+ exclude = [" .git/" , " tests/data/" , " tests/fixture/" ]
58+ # NOTE: the following regex matches must be kept in sync with isort skip
59+ extend-exclude = [
60+ " bin/checkconf.py" ,
61+ " bin/createresource.py" ,
62+ " bin/notifypassword.py" ,
63+ " sbin/grid_ftps.py" ,
64+ " sbin/grid_openid.py" ,
65+ " sbin/grid_sftp.py" ,
66+ " sbin/grid_webdavs.py"
67+ ]
You can’t perform that action at this time.
0 commit comments