File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ ifndef PY
66 PY = 3
77endif
88
9- FORMAT_ENFORCE_DIRS = ./bin ./mig/lib ./sbin ./tests
10- FORMAT_EXCLUDE_REGEX = '.git|tests/data/|tests/fixture/|bin/checkconf.py|bin/createresource.py|bin/notifypassword.py|sbin/grid\_ftps.py|sbin/grid\_openid.py|sbin/grid\_sftp.py|sbin/grid\_webdavs.py'
11- FORMAT_LINE_LENGTH = 80
9+ LINT_ENFORCE_DIRS = ./bin ./mig/lib ./sbin ./tests
1210LOCAL_PYTHON_BIN = './envhelp/lpython'
1311
1412ifdef PYTHON_BIN
@@ -40,14 +38,10 @@ ifneq ($(MIG_ENV),'local')
4038endif
4139 @make format-python
4240
43- .PHONY :format-python
41+ .PHONY : format-python
4442format-python :
45- @$(LOCAL_PYTHON_BIN ) -m black $(FORMAT_ENFORCE_DIRS ) \
46- --line-length=$(FORMAT_LINE_LENGTH ) \
47- --exclude=$(FORMAT_EXCLUDE_REGEX )
48- @$(LOCAL_PYTHON_BIN ) -m isort $(FORMAT_ENFORCE_DIRS ) \
49- --profile=black \
50- --line-length=$(FORMAT_LINE_LENGTH )
43+ @$(LOCAL_PYTHON_BIN ) -m black $(LINT_ENFORCE_DIRS )
44+ @$(LOCAL_PYTHON_BIN ) -m isort $(LINT_ENFORCE_DIRS )
5145
5246.PHONY : lint
5347lint :
5953
6054.PHONY : lint-python
6155lint-python :
62- @$(LOCAL_PYTHON_BIN ) -m black $(FORMAT_ENFORCE_DIRS ) \
63- --check \
64- --line-length=$(FORMAT_LINE_LENGTH ) \
65- --exclude $(FORMAT_EXCLUDE_REGEX )
66- @$(LOCAL_PYTHON_BIN ) -m isort $(FORMAT_ENFORCE_DIRS ) \
67- --check-only \
68- --profile=black \
69- --line-length=$(FORMAT_LINE_LENGTH ) \
70- --skip-glob=$(FORMAT_EXCLUDE_GLOB )
56+ @$(LOCAL_PYTHON_BIN ) -m black $(LINT_ENFORCE_DIRS ) --check
57+ @$(LOCAL_PYTHON_BIN ) -m isort $(LINT_ENFORCE_DIRS ) --check-only
7158
7259.PHONY : clean
7360clean :
Original file line number Diff line number Diff line change 1+ # Project wide settings including tooling.
2+
3+ # Linting tools
4+ # TODO: fix CodeQL errors in the symlinked files and disable exclude+skip here
5+
6+ [tool .black ]
7+ line-length = 80
8+ # NOTE: the following regex matches us be kept in sync with isort skip
9+ extend-exclude = '''
10+ tests/data/
11+ | tests/fixture/
12+ | bin/checkconf.py
13+ | bin/createresource.py
14+ | bin/notifypassword.py
15+ | sbin/grid_ftps.py|sbin/grid_openid.py
16+ | sbin/grid_sftp.py|sbin/grid_webdavs.py
17+ '''
18+
19+ [tool .isort ]
20+ profile = " black"
21+ line_length = 80
22+ # NOTE: the following paths must be kept in sync with black extend-exclude
23+ skip = [
24+ " bin/notifypassword.py" ,
25+ " bin/checkconf.py" ,
26+ " bin/createresource.py" ,
27+ " sbin/grid_ftps.py" ,
28+ " sbin/grid_openid.py" ,
29+ " sbin/grid_sftp.py" ,
30+ " sbin/grid_webdavs.py"
31+ ]
32+ skip_glob = [" .git/*" , " tests/data/*" , " tests/fixture/*" ]
You can’t perform that action at this time.
0 commit comments