Skip to content

Commit 554ca16

Browse files
committed
ci(prettier): add Prettier code formatting checks
Also add .prettierignore for ignored files and .prettierrc.yaml for standard print width.
1 parent f7628af commit 554ca16

12 files changed

Lines changed: 169 additions & 372 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,20 @@ jobs:
5454
pip install black
5555
./run-tests.sh --format-black
5656
57+
format-prettier:
58+
runs-on: ubuntu-24.04
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Node
64+
uses: actions/setup-node@v4
65+
66+
- name: Check Prettier code formatting
67+
run: |
68+
npm install prettier --global
69+
./run-tests.sh --format-prettier
70+
5771
format-shfmt:
5872
runs-on: ubuntu-24.04
5973
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-commons/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-commons/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
@@ -13,6 +13,8 @@ include *.yml
1313
include .dockerignore
1414
include .editorconfig
1515
include .flake8
16+
include .prettierignore
17+
include .prettierrc.yaml
1618
include LICENSE
1719
include pytest.ini
1820
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
REANA-Commons is a component of the [REANA](http://www.reana.io/) reusable and
14-
reproducible research data analysis platform. It provides common utilities and schemas
15-
shared by the REANA cluster components.
14+
reproducible research data analysis platform. It provides common utilities and
15+
schemas shared by the REANA cluster components.
1616

1717
## Features
1818

reana_commons/openapi_specifications/reana_job_controller.json

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@
171171
"type": "string"
172172
}
173173
],
174-
"produces": [
175-
"application/json"
176-
],
174+
"produces": ["application/json"],
177175
"responses": {
178176
"200": {
179177
"description": "Request succeeded. Returns boolean depicting if job is in cache.",
@@ -198,9 +196,7 @@
198196
"get": {
199197
"description": "This resource is not expecting parameters and it will return a list representing all active jobs in JSON format.",
200198
"operationId": "get_jobs",
201-
"produces": [
202-
"application/json"
203-
],
199+
"produces": ["application/json"],
204200
"responses": {
205201
"200": {
206202
"description": "Request succeeded. The response contains the list of all active jobs.",
@@ -209,10 +205,7 @@
209205
"jobs": {
210206
"1612a779-f3fa-4344-8819-3d12fa9b9d90": {
211207
"cmd": "date",
212-
"cvmfs_mounts": [
213-
"atlas.cern.ch",
214-
"atlas-condb.cern.ch"
215-
],
208+
"cvmfs_mounts": ["atlas.cern.ch", "atlas-condb.cern.ch"],
216209
"docker_img": "docker.io/library/busybox",
217210
"job_id": "1612a779-f3fa-4344-8819-3d12fa9b9d90",
218211
"max_restart_count": 3,
@@ -221,10 +214,7 @@
221214
},
222215
"2e4bbc1d-db5e-4ee0-9701-6e2b1ba55c20": {
223216
"cmd": "date",
224-
"cvmfs_mounts": [
225-
"atlas.cern.ch",
226-
"atlas-condb.cern.ch"
227-
],
217+
"cvmfs_mounts": ["atlas.cern.ch", "atlas-condb.cern.ch"],
228218
"docker_img": "docker.io/library/busybox",
229219
"job_id": "2e4bbc1d-db5e-4ee0-9701-6e2b1ba55c20",
230220
"max_restart_count": 3,
@@ -245,9 +235,7 @@
245235
"summary": "Returns list of all active jobs."
246236
},
247237
"post": {
248-
"consumes": [
249-
"application/json"
250-
],
238+
"consumes": ["application/json"],
251239
"description": "This resource is expecting JSON data with all the necessary information of a new job.",
252240
"operationId": "create_job",
253241
"parameters": [
@@ -261,9 +249,7 @@
261249
}
262250
}
263251
],
264-
"produces": [
265-
"application/json"
266-
],
252+
"produces": ["application/json"],
267253
"responses": {
268254
"201": {
269255
"description": "Request succeeded. The job has been launched.",
@@ -304,20 +290,15 @@
304290
"type": "string"
305291
}
306292
],
307-
"produces": [
308-
"application/json"
309-
],
293+
"produces": ["application/json"],
310294
"responses": {
311295
"200": {
312296
"description": "Request succeeded. The response contains details about the given job ID.",
313297
"examples": {
314298
"application/json": {
315299
"job": {
316300
"cmd": "date",
317-
"cvmfs_mounts": [
318-
"atlas.cern.ch",
319-
"atlas-condb.cern.ch"
320-
],
301+
"cvmfs_mounts": ["atlas.cern.ch", "atlas-condb.cern.ch"],
321302
"docker_img": "docker.io/library/busybox",
322303
"job_id": "cdcf48b1-c2f3-4693-8230-b066e088c6ac",
323304
"max_restart_count": 3,
@@ -344,9 +325,7 @@
344325
},
345326
"/jobs/{job_id}/": {
346327
"delete": {
347-
"consumes": [
348-
"application/json"
349-
],
328+
"consumes": ["application/json"],
350329
"description": "This resource expects the `job_id` of the job to be deleted.",
351330
"operationId": "delete_job",
352331
"parameters": [
@@ -365,9 +344,7 @@
365344
"type": "string"
366345
}
367346
],
368-
"produces": [
369-
"application/json"
370-
],
347+
"produces": ["application/json"],
371348
"responses": {
372349
"204": {
373350
"description": "Request accepted. A request to delete the job has been sent to the\n compute backend."
@@ -405,9 +382,7 @@
405382
"type": "string"
406383
}
407384
],
408-
"produces": [
409-
"application/json"
410-
],
385+
"produces": ["application/json"],
411386
"responses": {
412387
"200": {
413388
"description": "Request succeeded. The response contains the logs for the given job.",
@@ -431,14 +406,10 @@
431406
},
432407
"/shutdown": {
433408
"delete": {
434-
"consumes": [
435-
"application/json"
436-
],
409+
"consumes": ["application/json"],
437410
"description": "All running jobs will be stopped and no more jobs will be scheduled. Kubernetes will call this endpoint before stopping the pod (PreStop hook).",
438411
"operationId": "shutdown",
439-
"produces": [
440-
"application/json"
441-
],
412+
"produces": ["application/json"],
442413
"responses": {
443414
"200": {
444415
"description": "Request successful. All jobs were stopped.",

0 commit comments

Comments
 (0)