Skip to content

Commit

Permalink
ci(prettier): add Prettier code formatting checks (reanahub#838)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborsimko committed Nov 14, 2024
1 parent 32c52ae commit e1d45d0
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 20 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,17 @@ jobs:
run: |
npm install markdownlint-cli2 --global
./run-tests.sh --check-markdownlint
lint-prettier:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4

- name: Check Prettier code fomatting
run: |
npm install prettier --global
./run-tests.sh --check-prettier
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
helm/reana
2 changes: 2 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
printWidth: 80
proseWrap: always
8 changes: 6 additions & 2 deletions .release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
".": {
"changelog-sections": [
{ "type": "build", "section": "Build", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug fixes", "hidden": false },
{ "type": "perf", "section": "Performance improvements", "hidden": false },
{
"type": "perf",
"section": "Performance improvements",
"hidden": false
},
{ "type": "refactor", "section": "Code refactoring", "hidden": false },
{ "type": "style", "section": "Code style", "hidden": false },
{ "type": "test", "section": "Test suite", "hidden": false },
Expand Down
4 changes: 3 additions & 1 deletion .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
extends: default

rules:
comments:
min-spaces-from-content: 1
document-start: disable
line-length: disable
truthy: disable

ignore:
- helm/reana # is linted by `helm lint` and `ct lint`
- helm/reana # is linted by `helm lint` and `ct lint`
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- prettier-ignore-start -->
# Changelog

## [0.9.3](https://github.com/reanahub/reana/compare/0.9.2...0.9.3) (2024-03-13)
Expand Down Expand Up @@ -834,3 +835,5 @@ post](https://blog.reana.io/posts/2024/reana-0.9.3) for more information.
## 0.1.0 (2018-01-30)

* Initial public release.

<!-- prettier-ignore-end -->
11 changes: 6 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

## Issues

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

1. Search for [already reported problems](https://github.com/search?q=org%3Areanahub+is%3Aissue+is%3Aopen).
2. Check if the issue has been fixed or is still reproducible on the
latest `master` branch.
1. Search for
[already reported problems](https://github.com/search?q=org%3Areanahub+is%3Aissue+is%3Aopen).
2. Check if the issue has been fixed or is still reproducible on the latest
`master` branch.
3. Create an issue, ideally with **a test case**.

If you create a pull request fixing a bug or implementing a feature, you can run
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ include .flake8
include LICENSE
include pytest.ini
exclude .editorconfig
exclude .prettierrc
exclude .prettierignore
exclude .readthedocs.yaml
prune docs/_build
recursive-include reana *.py
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@

## About

[REANA](http://www.reana.io) is a reusable and reproducible research data analysis
platform. It helps researchers to structure their input data, analysis code,
containerised environments and computational workflows so that the analysis can be
instantiated and run on remote compute clouds.
[REANA](http://www.reana.io) is a reusable and reproducible research data
analysis platform. It helps researchers to structure their input data, analysis
code, containerised environments and computational workflows so that the
analysis can be instantiated and run on remote compute clouds.

REANA was born to target the use case of particle physics analyses, but is applicable to
any scientific discipline. The system paves the way towards reusing and reinterpreting
preserved data analyses even several years after the original publication.
REANA was born to target the use case of particle physics analyses, but is
applicable to any scientific discipline. The system paves the way towards
reusing and reinterpreting preserved data analyses even several years after the
original publication.

## Features

Expand All @@ -35,10 +36,11 @@ preserved data analyses even several years after the original publication.
You can
[install REANA locally](https://docs.reana.io/administration/deployment/deploying-locally/),
[deploy it at scale on premises](https://docs.reana.io/administration/deployment/deploying-at-scale/)
(in about 10 minutes) or use <https://reana.cern.ch>. Once the system is ready, you can
follow the guide to run
[your first example](https://docs.reana.io/getting-started/first-example/). For more in
depth information visit the [official REANA documentation](https://docs.reana.io/).
(in about 10 minutes) or use <https://reana.cern.ch>. Once the system is ready,
you can follow the guide to run
[your first example](https://docs.reana.io/getting-started/first-example/). For
more in depth information visit the
[official REANA documentation](https://docs.reana.io/).

## Community

Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# REANA

REANA documentation has been moved, please visit our new documentation website [docs.reana.io](https://docs.reana.io).
REANA documentation has been moved, please visit our new documentation website
[docs.reana.io](https://docs.reana.io).
6 changes: 6 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ check_markdownlint () {
markdownlint-cli2 "**/*.md"
}

check_prettier () {
prettier -c .
}

check_all () {
check_commitlint
check_shellcheck
Expand All @@ -95,6 +99,7 @@ check_all () {
check_helm
check_yamllint
check_markdownlint
check_prettier
}

if [ $# -eq 0 ]; then
Expand All @@ -115,5 +120,6 @@ case $arg in
--check-helm) check_helm;;
--check-yamllint) check_yamllint;;
--check-markdownlint) check_markdownlint;;
--check-prettier) check_prettier;;
*) echo "[ERROR] Invalid argument '$arg'. Exiting." && exit 1;;
esac

0 comments on commit e1d45d0

Please sign in to comment.