Skip to content

Commit 3dff0a6

Browse files
committed
Devops: Add a YAML and TOML formatter
1 parent decea16 commit 3dff0a6

File tree

21 files changed

+1080
-1266
lines changed

21 files changed

+1080
-1266
lines changed

.github/workflows/cd.yml

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
11
name: cd
22

33
on:
4-
push:
5-
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+*'
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+*
77

88
jobs:
99

10-
validate-release-tag:
10+
validate-release-tag:
1111

12-
if: github.repository == 'aiidateam/aiida-common-workflows'
13-
runs-on: ubuntu-latest
12+
if: github.repository == 'aiidateam/aiida-common-workflows'
13+
runs-on: ubuntu-latest
1414

15-
steps:
16-
- name: Checkout source
17-
uses: actions/checkout@v2
15+
steps:
16+
- name: Checkout source
17+
uses: actions/checkout@v2
1818

19-
- name: Set up Python 3.9
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: '3.9'
19+
- name: Set up Python 3.9
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.9'
2323

24-
- name: Validate the tag version against the package version
25-
run: python .github/workflows/validate_release_tag.py $GITHUB_REF
24+
- name: Validate the tag version against the package version
25+
run: python .github/workflows/validate_release_tag.py $GITHUB_REF
2626

27-
pre-commit:
27+
pre-commit:
2828

29-
needs: [validate-release-tag]
30-
runs-on: ubuntu-latest
29+
needs: [validate-release-tag]
30+
runs-on: ubuntu-latest
3131

32-
steps:
33-
- uses: actions/checkout@v2
32+
steps:
33+
- uses: actions/checkout@v2
3434

35-
- name: Install Python
36-
uses: actions/setup-python@v4
37-
with:
38-
python-version: '3.9'
39-
cache: 'pip'
40-
cache-dependency-path: pyproject.toml
35+
- name: Install Python
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: '3.9'
39+
cache: pip
40+
cache-dependency-path: pyproject.toml
4141

42-
- name: Update pip and install wheel
43-
run: pip install -U pip wheel
42+
- name: Update pip and install wheel
43+
run: pip install -U pip wheel
4444

45-
- name: Install Python package and dependencies
46-
run: pip install -e .[docs,pre-commit,tests]
45+
- name: Install Python package and dependencies
46+
run: pip install -e .[docs,pre-commit,tests]
4747

48-
- name: Run pre-commit
49-
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
48+
- name: Run pre-commit
49+
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
5050

51-
tests:
51+
tests:
5252

53-
needs: [validate-release-tag]
54-
runs-on: ubuntu-latest
55-
timeout-minutes: 30
53+
needs: [validate-release-tag]
54+
runs-on: ubuntu-latest
55+
timeout-minutes: 30
5656

57-
strategy:
58-
matrix:
59-
python-version: ['3.9', '3.10', '3.11', '3.12']
57+
strategy:
58+
matrix:
59+
python-version: ['3.9', '3.10', '3.11', '3.12']
6060

61-
services:
62-
rabbitmq:
63-
image: rabbitmq:latest
64-
ports:
65-
- 5672:5672
61+
services:
62+
rabbitmq:
63+
image: rabbitmq:latest
64+
ports:
65+
- 5672:5672
6666

67-
steps:
68-
- uses: actions/checkout@v2
67+
steps:
68+
- uses: actions/checkout@v2
6969

70-
- name: Install Python ${{ matrix.python-version }}
71-
uses: actions/setup-python@v4
72-
with:
73-
python-version: ${{ matrix.python-version }}
74-
cache: 'pip'
75-
cache-dependency-path: pyproject.toml
70+
- name: Install Python ${{ matrix.python-version }}
71+
uses: actions/setup-python@v4
72+
with:
73+
python-version: ${{ matrix.python-version }}
74+
cache: pip
75+
cache-dependency-path: pyproject.toml
7676

77-
- name: Update pip and install wheel
78-
run: pip install -U pip wheel
77+
- name: Update pip and install wheel
78+
run: pip install -U pip wheel
7979

80-
- name: Install Python package and dependencies
81-
run: pip install -e .[tests]
80+
- name: Install Python package and dependencies
81+
run: pip install -e .[tests]
8282

83-
- name: Run pytest
84-
run: pytest -sv tests
83+
- name: Run pytest
84+
run: pytest -sv tests
8585

86-
publish:
86+
publish:
8787

88-
name: Publish to PyPI
89-
needs: [pre-commit, tests]
90-
runs-on: ubuntu-latest
88+
name: Publish to PyPI
89+
needs: [pre-commit, tests]
90+
runs-on: ubuntu-latest
9191

92-
steps:
93-
- name: Checkout source
94-
uses: actions/checkout@v2
92+
steps:
93+
- name: Checkout source
94+
uses: actions/checkout@v2
9595

96-
- name: Set up Python 3.9
97-
uses: actions/setup-python@v4
98-
with:
99-
python-version: '3.9'
96+
- name: Set up Python 3.9
97+
uses: actions/setup-python@v4
98+
with:
99+
python-version: '3.9'
100100

101-
- name: Install flit
102-
run: pip install flit~=3.4
101+
- name: Install flit
102+
run: pip install flit~=3.4
103103

104-
- name: Build and publish
105-
run: flit publish
106-
env:
107-
FLIT_USERNAME: __token__
108-
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}
104+
- name: Build and publish
105+
run: flit publish
106+
env:
107+
FLIT_USERNAME: __token__
108+
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}

.github/workflows/ci.yml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,61 @@ on: [push, pull_request]
44

55
jobs:
66

7-
pre-commit:
7+
pre-commit:
88

9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-latest
1010

11-
steps:
12-
- uses: actions/checkout@v2
11+
steps:
12+
- uses: actions/checkout@v2
1313

14-
- name: Install Python
15-
uses: actions/setup-python@v4
16-
with:
17-
python-version: '3.9'
18-
cache: 'pip'
19-
cache-dependency-path: pyproject.toml
14+
- name: Install Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.9'
18+
cache: pip
19+
cache-dependency-path: pyproject.toml
2020

21-
- name: Update pip and install wheel
22-
run: pip install -U pip wheel
21+
- name: Update pip and install wheel
22+
run: pip install -U pip wheel
2323

24-
- name: Install Python package and dependencies
25-
run: pip install -e .[docs,pre-commit,tests]
24+
- name: Install Python package and dependencies
25+
run: pip install -e .[docs,pre-commit,tests]
2626

27-
- name: Run pre-commit
28-
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
27+
- name: Run pre-commit
28+
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
2929

30-
tests:
30+
tests:
3131

32-
runs-on: ubuntu-latest
33-
timeout-minutes: 30
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 30
3434

35-
strategy:
36-
matrix:
37-
python-version: ['3.9', '3.10', '3.11', '3.12']
35+
strategy:
36+
matrix:
37+
python-version: ['3.9', '3.10', '3.11', '3.12']
3838

39-
services:
40-
rabbitmq:
41-
image: rabbitmq:latest
42-
ports:
43-
- 5672:5672
39+
services:
40+
rabbitmq:
41+
image: rabbitmq:latest
42+
ports:
43+
- 5672:5672
4444

45-
steps:
46-
- uses: actions/checkout@v2
45+
steps:
46+
- uses: actions/checkout@v2
4747

48-
- name: Install Python ${{ matrix.python-version }}
49-
uses: actions/setup-python@v4
50-
with:
51-
python-version: ${{ matrix.python-version }}
52-
cache: 'pip'
53-
cache-dependency-path: pyproject.toml
48+
- name: Install Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
cache: pip
53+
cache-dependency-path: pyproject.toml
5454

55-
- name: Update pip and install wheel
56-
run: pip install -U pip wheel
55+
- name: Update pip and install wheel
56+
run: pip install -U pip wheel
5757

58-
- name: Install Python package and dependencies
59-
run: pip install -e .[tests]
58+
- name: Install Python package and dependencies
59+
run: pip install -e .[tests]
6060

61-
- name: Run pytest
62-
env:
63-
AIIDA_WARN_v3: true
64-
run: pytest -sv tests
61+
- name: Run pytest
62+
env:
63+
AIIDA_WARN_v3: true
64+
run: pytest -sv tests

.pre-commit-config.yaml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
4-
hooks:
5-
- id: check-merge-conflict
6-
- id: check-yaml
7-
- id: double-quote-string-fixer
8-
- id: end-of-file-fixer
9-
- id: fix-encoding-pragma
10-
args: [--remove]
11-
- id: mixed-line-ending
12-
args: [--fix=lf]
13-
- id: trailing-whitespace
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: check-yaml
7+
- id: double-quote-string-fixer
8+
- id: end-of-file-fixer
9+
- id: fix-encoding-pragma
10+
args: [--remove]
11+
- id: mixed-line-ending
12+
args: [--fix=lf]
13+
- id: trailing-whitespace
1414

15-
- repo: https://github.com/ikamensh/flynt/
16-
rev: '1.0.1'
17-
hooks:
18-
- id: flynt
15+
- repo: https://github.com/ikamensh/flynt/
16+
rev: 1.0.1
17+
hooks:
18+
- id: flynt
1919

2020
- repo: https://github.com/astral-sh/ruff-pre-commit
2121
rev: v0.1.9
2222
hooks:
2323
- id: ruff-format
2424
- id: ruff
2525
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
26+
27+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
28+
rev: v2.11.0
29+
hooks:
30+
- id: pretty-format-toml
31+
args: [--autofix]
32+
- id: pretty-format-yaml
33+
args: [--autofix]

.readthedocs.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
version: 2
22

33
build:
4-
apt_packages:
5-
- gfortran # This is necessary for the `sisl` dependency of `aiida-siesta`
4+
apt_packages:
5+
- gfortran # This is necessary for the `sisl` dependency of `aiida-siesta`
66

77
python:
8-
version: 3.8
9-
install:
10-
- method: pip
11-
path: .
12-
extra_requirements:
13-
- docs
8+
version: 3.8
9+
install:
10+
- method: pip
11+
path: .
12+
extra_requirements:
13+
- docs
1414

1515
sphinx:
16-
builder: html
17-
fail_on_warning: true
16+
builder: html
17+
fail_on_warning: true

0 commit comments

Comments
 (0)