1
- name : ' Lint Code'
1
+ name : Lint Code
2
2
3
3
on :
4
4
push :
@@ -10,54 +10,39 @@ jobs:
10
10
lint_python :
11
11
name : Lint Python Files
12
12
runs-on : ubuntu-latest
13
-
14
13
steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v3
15
16
16
- - name : Checkout Repository
17
- uses : actions/checkout@v3
18
-
19
- - name : Set up Python
20
- uses : actions/setup-python@v4
21
- with :
22
- python-version : 3.12
23
-
24
- - name : Install dependencies
25
- run : |
26
- python -m pip install --upgrade pip
27
- pip install flake8
28
-
29
- - name : Print working directory
30
- run : pwd
31
-
32
- - name : Run Linter
33
- run : |
34
- flake8 . \
35
- --max-line-length=120 \
36
- --ignore=F401,E402,W292,W293,E501 \
37
- --exclude=venv,.git,__pycache__,migrations
38
- #pwd
39
- # This command finds all Python files recursively and runs flake8 on them
40
- #find . -name "*.py" -exec flake8 {} +
41
- echo "Linted all the python files successfully"
17
+ - name : Set up Python
18
+ uses : actions/setup-python@v4 # official action :contentReference[oaicite:0]{index=0}
19
+ with :
20
+ python-version : " 3.12"
42
21
43
- lint_js :
44
- name : Lint JavaScript Files
45
- runs-on : ubuntu-latest
22
+ - name : Install Flake8
23
+ run : |
24
+ python -m pip install --upgrade pip
25
+ pip install flake8 # standard CLI install :contentReference[oaicite:1]{index=1}
46
26
47
- steps :
48
- - name : Checkout Repository
27
+ - name : Run Flake8
28
+ run : flake8 . --extend-ignore=F401,F403,E225,E231,E265,E301,E302,E303,E722,E501,W292,W293,W391,W503,W504,W605,E731
29
+ # ignore: F401,F403,E225,E231,E265,E301,E302,E303,E722,E501,W292,W293,W391,W503,W504,W605,E722,E731
30
+
31
+
32
+ lint_js :
33
+ name : Lint JavaScript Files
34
+ runs-on : ubuntu-latest
35
+ steps :
36
+ - name : Checkout
49
37
uses : actions/checkout@v3
50
38
51
- - name : Install Node.js
52
- uses : actions/setup-node@v3
39
+ - name : Set up Node
40
+ uses : actions/setup-node@v3 # GitHub‑maintained action :contentReference[oaicite:2]{index=2}
53
41
with :
54
- node-version : 14
42
+ node-version : " 18 " # any modern LTS is fine :contentReference[oaicite:3]{index=3}
55
43
56
44
- name : Install JSHint
57
- run : npm install jshint --global
45
+ run : npm install --global jshint # official install cmd :contentReference[oaicite:4]{index=4}
58
46
59
- - name : Run Linter
60
- run : |
61
- # This command finds all JavaScript files recursively and runs JSHint on them
62
- find ./server/database -name "*.js" -exec jshint {} +
63
- echo "Linted all the js files successfully"
47
+ - name : Run JSHint
48
+ run : jshint ./server/database
0 commit comments