Skip to content

Commit cd7c437

Browse files
authored
Update main.yml
1 parent c2f4449 commit cd7c437

File tree

1 file changed

+27
-42
lines changed

1 file changed

+27
-42
lines changed

.github/workflows/main.yml

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Lint Code'
1+
name: Lint Code
22

33
on:
44
push:
@@ -10,54 +10,39 @@ jobs:
1010
lint_python:
1111
name: Lint Python Files
1212
runs-on: ubuntu-latest
13-
1413
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
1516

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"
4221

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}
4626
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
4937
uses: actions/checkout@v3
5038

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}
5341
with:
54-
node-version: 14
42+
node-version: "18" # any modern LTS is fine :contentReference[oaicite:3]{index=3}
5543

5644
- name: Install JSHint
57-
run: npm install jshint --global
45+
run: npm install --global jshint # official install cmd :contentReference[oaicite:4]{index=4}
5846

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

Comments
 (0)