Skip to content

Commit d65ce98

Browse files
committed
Use Task to run formatting operation
The project uses Task as the runner for all common development processes.
1 parent c1b5823 commit d65ce98

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.github/workflows/setup-taskflile.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ jobs:
3434
- name: Install dependencies
3535
run: task ts:install-deps
3636

37-
- name: npm lint
38-
run: npm run format-check
37+
- name: Format with Prettier
38+
run: task general:format
39+
40+
- name: Check formatting
41+
run: git diff --color --exit-code
3942

4043
- name: Run tests
4144
run: task ts:test

Taskfile.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ tasks:
66
deps:
77
- task: ts:build
88

9+
format:
10+
desc: Format all files
11+
deps:
12+
- task: general:format
13+
914
check:
1015
desc: Check for problems with the project
1116
deps:
@@ -78,6 +83,11 @@ tasks:
7883
done
7984
exit $STATUS'
8085
86+
general:format:
87+
desc: Format all supported files with Prettier
88+
cmds:
89+
- npx prettier --write .
90+
8191
general:check-spelling:
8292
desc: Check for commonly misspelled words
8393
cmds:

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"private": true,
55
"description": "Setup Task action",
66
"main": "lib/main.js",
7-
"scripts": {
8-
"format": "prettier --write .",
9-
"format-check": "prettier --check ."
10-
},
117
"repository": {
128
"type": "git",
139
"url": "git+https://github.com/arduino/setup-task.git"

0 commit comments

Comments
 (0)