Skip to content

Commit f91e73d

Browse files
committed
ci(prettier): add Prettier code formatting checks (#175) (#175)
1 parent 048353b commit f91e73d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+131
-123
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Go
1919
uses: actions/setup-go@v5
2020
with:
21-
go-version: '1.25.7'
21+
go-version: "1.25.7"
2222

2323
- name: Check shell completions are up-to-date
2424
run: ./run-tests.sh --docs-shell-completions
@@ -32,11 +32,25 @@ jobs:
3232
- name: Setup Go
3333
uses: actions/setup-go@v5
3434
with:
35-
go-version: '1.25.7'
35+
go-version: "1.25.7"
3636

3737
- name: Check Go code formatting
3838
run: ./run-tests.sh --format-go
3939

40+
format-prettier:
41+
runs-on: ubuntu-24.04
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Setup Node
47+
uses: actions/setup-node@v4
48+
49+
- name: Check Prettier code formatting
50+
run: |
51+
npm install prettier --global
52+
./run-tests.sh --format-prettier
53+
4054
format-shfmt:
4155
runs-on: ubuntu-24.04
4256
steps:
@@ -57,7 +71,7 @@ jobs:
5771
- name: Setup Go
5872
uses: actions/setup-go@v5
5973
with:
60-
go-version: '1.25.7'
74+
go-version: "1.25.7"
6175

6276
- name: Run Go test suite
6377
run: ./run-tests.sh --go-tests
@@ -102,7 +116,7 @@ jobs:
102116
- name: Setup Go
103117
uses: actions/setup-go@v5
104118
with:
105-
go-version: '1.25.7'
119+
go-version: "1.25.7"
106120

107121
- name: Run Go audit checks
108122
run: ./run-tests.sh --lint-goaudit

.markdownlint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Allow prompt dollar sign in console examples without showing output
2-
MD014: false
2+
MD014: false

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.pytest_cache
2+
CHANGELOG.md

.prettierrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
printWidth: 80
2+
proseWrap: always

CONTRIBUTING.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Contributing
22

3-
Bug reports, issues, feature requests, and other contributions are welcome.
4-
If you find a demonstrable problem that is caused by the REANA code, please:
3+
Bug reports, issues, feature requests, and other contributions are welcome. If
4+
you find a demonstrable problem that is caused by the REANA code, please:
55

6-
1. Search for [already reported problems](https://github.com/reanahub/reana-client-go/issues).
7-
2. Check if the issue has been fixed or is still reproducible on the
8-
latest `master` branch.
6+
1. Search for
7+
[already reported problems](https://github.com/reanahub/reana-client-go/issues).
8+
2. Check if the issue has been fixed or is still reproducible on the latest
9+
`master` branch.
910
3. Create an issue, ideally with **a test case**.
1011

1112
If you create a pull request fixing a bug or implementing a feature, you can run

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
## About
99

10-
REANA-Client-Go is a component of the [REANA](https://www.reana.io/)
11-
reusable and reproducible research data analysis platform. It provides a
12-
command-line tool that allows researchers to submit, run, and manage
13-
their computational workflows.
10+
REANA-Client-Go is a component of the [REANA](https://www.reana.io/) reusable
11+
and reproducible research data analysis platform. It provides a command-line
12+
tool that allows researchers to submit, run, and manage their computational
13+
workflows.
1414

1515
- seed workspace with input code and data
1616
- run computational workflows on remote compute clouds

run-tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ lint_yamllint() {
115115
all() {
116116
docs_shell_completions
117117
format_go
118+
format_prettier
118119
format_shfmt
119120
go_tests
120121
lint_commitlint
@@ -130,6 +131,7 @@ help() {
130131
echo " --all Perform all checks [default]"
131132
echo " --docs-shell-completions Check shell completions are up-to-date"
132133
echo " --format-go Check formatting of Go code"
134+
echo " --format-prettier Check formatting of Markdown etc files"
133135
echo " --format-shfmt Check formatting of shell scripts"
134136
echo " --go-tests Check Go test suite"
135137
echo " --help Display this help message"
@@ -151,6 +153,7 @@ case $arg in
151153
--help) help ;;
152154
--docs-shell-completions) docs_shell_completions ;;
153155
--format-go) format_go ;;
156+
--format-prettier) format_prettier ;;
154157
--format-shfmt) format_shfmt ;;
155158
--go-tests) go_tests ;;
156159
--lint-commitlint) lint_commitlint "$@" ;;

testdata/inputs/close_no_open.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"message": "Workflow - my_workflow has no open interactive session."
3-
}
3+
}

testdata/inputs/common_empty.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

testdata/inputs/common_failed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"user": "user",
55
"workflow_id": "my_workflow_id",
66
"workflow_name": "my_workflow"
7-
}
7+
}

0 commit comments

Comments
 (0)