Skip to content

Commit c735344

Browse files
authored
Change lint to use command (#372)
* Change lint to use command * Use makefile
1 parent 967e52b commit c735344

6 files changed

Lines changed: 36 additions & 20 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ contributing to this repository.
2626
[references AEPs](https://aep.dev/style-guide#referencing-aeps)
2727
correctly.
2828
- [ ] [My code has been formatted](https://aep.dev/contributing#formatting)
29-
(usually `prettier -w .`)
30-
- [ ] [I have run `./scripts/fix.py`](https://aep.dev/contributing#formatting)
29+
(run `make lint`)
3130

3231
<!-- uncomment this if PR is for a new AEP
3332

.github/workflows/lint.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,16 @@ on:
55
branches:
66
- main
77
jobs:
8-
lint:
9-
runs-on: ubuntu-latest
10-
container: node:20
11-
steps:
12-
- uses: actions/checkout@v3
13-
# this must be installed to use the prettier version
14-
# from the package.json file.
15-
- name: install prettier.
16-
run: npm install .
17-
- name: verify with prettier.
18-
run: npx prettier --check .
19-
fix:
8+
check:
209
runs-on: ubuntu-latest
2110
container: python:3.12
2211
steps:
2312
- uses: actions/checkout@v3
24-
- name: verify with fix.py
25-
run: python scripts/fix.py --check --path ./aep/general/
13+
- name: install node.
14+
run: |
15+
apt-get update
16+
apt-get install -y nodejs npm
17+
- name: install dependencies.
18+
run: make install
19+
- name: run check command.
20+
run: make check

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ for the specific file.
8080
Run the following to format the repository:
8181

8282
```bash
83-
# nodejs must be installed.
84-
npx prettier -w .
85-
# python3 must be installed
86-
./scripts/fix.py
83+
# nodejs and python3 must be installed.
84+
make lint
8785
```

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.PHONY: lint check install help
2+
3+
help:
4+
@echo "Available targets:"
5+
@echo " make install - Install dependencies (npm install)"
6+
@echo " make lint - Format code and run all linting checks"
7+
@echo " make check - Run all linting checks without modifying files"
8+
9+
install:
10+
npm install .
11+
12+
lint:
13+
npm run lint
14+
python scripts/fix.py --path ./aep/general/
15+
python scripts/validate_links.py
16+
17+
check:
18+
npm run check
19+
python scripts/fix.py --check --path ./aep/general/
20+
python scripts/validate_links.py

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "aep.dev",
33
"private": true,
4+
"scripts": {
5+
"check": "prettier --check .",
6+
"lint": "prettier --write ."
7+
},
48
"devDependencies": {
59
"prettier": "3.5.1"
610
},

0 commit comments

Comments
 (0)