Skip to content

Commit 60f1fe3

Browse files
committed
ci(prettier): add Prettier code formatting checks (#150)
1 parent 8cca5e7 commit 60f1fe3

8 files changed

Lines changed: 41 additions & 9 deletions

File tree

.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/pytest-reana/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/pytest-reana/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
@@ -14,6 +14,8 @@ include *.yaml
1414
include .dockerignore
1515
include .editorconfig
1616
include .flake8
17+
include .prettierignore
18+
include .prettierrc.yaml
1719
include LICENSE
1820
include pytest.ini
1921
include tox.ini

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
## About
1212

1313
pytest-REANA is a component of the [REANA](http://www.reana.io/) reusable and
14-
reproducible research data analysis platform. It provides pytest fixtures and test
15-
utilities.
14+
reproducible research data analysis platform. It provides pytest fixtures and
15+
test utilities.
1616

1717
## Features
1818

run-tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ format_black() {
1717
black --check .
1818
}
1919

20+
format_prettier() {
21+
prettier -c .
22+
}
23+
2024
format_shfmt() {
2125
shfmt -d .
2226
}
@@ -94,6 +98,7 @@ python_tests() {
9498
all() {
9599
docs_sphinx
96100
format_black
101+
format_prettier
97102
format_shfmt
98103
lint_commitlint
99104
lint_flake8
@@ -112,6 +117,7 @@ help() {
112117
echo " --all Perform all checks [default]"
113118
echo " --docs-sphinx Check Sphinx docs build"
114119
echo " --format-black Check formatting of Python code"
120+
echo " --format-prettier Check formatting of Markdown etc files"
115121
echo " --format-shfmt Check formatting of shell scripts"
116122
echo " --help Display this help message"
117123
echo " --lint-commitlint Check linting of commit messages"
@@ -136,6 +142,7 @@ case $arg in
136142
--help) help ;;
137143
--docs-sphinx) docs_sphinx ;;
138144
--format-black) format_black ;;
145+
--format-prettier) format_prettier ;;
139146
--format-shfmt) format_shfmt ;;
140147
--lint-commitlint) lint_commitlint "$@" ;;
141148
--lint-flake8) lint_flake8 ;;

0 commit comments

Comments
 (0)