Skip to content

Commit 114e1e3

Browse files
committed
ci(prettier): add Prettier code formatting checks (#254)
1 parent cc0a9f9 commit 114e1e3

File tree

9 files changed

+44
-12
lines changed

9 files changed

+44
-12
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ jobs:
5151
pip install black
5252
./run-tests.sh --format-black
5353
54+
format-prettier:
55+
runs-on: ubuntu-24.04
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v4
59+
60+
- name: Setup Node
61+
uses: actions/setup-node@v4
62+
63+
- name: Check Prettier code formatting
64+
run: |
65+
npm install prettier --global
66+
./run-tests.sh --format-prettier
67+
5468
format-shfmt:
5569
runs-on: ubuntu-24.04
5670
steps:

.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

.release-please-config.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
".": {
66
"changelog-sections": [
77
{ "type": "build", "section": "Build", "hidden": false },
8-
{ "type": "feat", "section": "Features", "hidden": false },
8+
{ "type": "feat", "section": "Features", "hidden": false },
99
{ "type": "fix", "section": "Bug fixes", "hidden": false },
10-
{ "type": "perf", "section": "Performance improvements", "hidden": false },
10+
{
11+
"type": "perf",
12+
"section": "Performance improvements",
13+
"hidden": false
14+
},
1115
{ "type": "refactor", "section": "Code refactoring", "hidden": false },
1216
{ "type": "style", "section": "Code style", "hidden": false },
1317
{ "type": "test", "section": "Test suite", "hidden": false },

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-db/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-db/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

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ include *.yaml
1111
include .dockerignore
1212
include .editorconfig
1313
include .flake8
14+
include .prettierignore
15+
include .prettierrc.yaml
1416
include LICENSE
1517
include pytest.ini
1618
exclude .readthedocs.yaml

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
## About
1212

13-
REANA-DB is a component of the [REANA](http://www.reana.io/) reusable analysis platform.
14-
It contains REANA database models and utilities.
13+
REANA-DB is a component of the [REANA](http://www.reana.io/) reusable analysis
14+
platform. It contains REANA database models and utilities.
1515

1616
## Features
1717

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!-- markdownlint-disable MD041 -->
22
<!-- markdownlint-disable MD033 -->
33

4-
% The title is set to `REANA-DB docs` instead of `REANA-DB` as this is a
5-
% workaround to avoid having multiple HTML objects with the same id/anchor,
6-
% as the tile clashes with the CLI API documentation generated by sphinx_click
4+
% The title is set to `REANA-DB docs` instead of `REANA-DB` as this is a %
5+
workaround to avoid having multiple HTML objects with the same id/anchor, % as
6+
the tile clashes with the CLI API documentation generated by sphinx_click
77

88
# REANA-DB docs
99

run-tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ format_black() {
5555
black --check .
5656
}
5757

58+
format_prettier() {
59+
prettier -c .
60+
}
61+
5862
format_shfmt() {
5963
shfmt -d .
6064
}
@@ -136,6 +140,7 @@ python_tests() {
136140
all() {
137141
docs_sphinx
138142
format_black
143+
format_prettier
139144
format_shfmt
140145
lint_commitlint
141146
lint_flake8
@@ -154,6 +159,7 @@ help() {
154159
echo " --all Perform all checks [default]"
155160
echo " --docs-sphinx Check Sphinx docs build"
156161
echo " --format-black Check formatting of Python code"
162+
echo " --format-prettier Check formatting of Markdown etc files"
157163
echo " --format-shfmt Check formatting of shell scripts"
158164
echo " --help Display this help message"
159165
echo " --lint-commitlint Check linting of commit messages"
@@ -178,6 +184,7 @@ case $arg in
178184
--help) help ;;
179185
--docs-sphinx) docs_sphinx ;;
180186
--format-black) format_black ;;
187+
--format-prettier) format_prettier ;;
181188
--format-shfmt) format_shfmt ;;
182189
--lint-commitlint) lint_commitlint "$@" ;;
183190
--lint-flake8) lint_flake8 ;;

0 commit comments

Comments
 (0)