Skip to content

Commit e821d7d

Browse files
committed
Added yaml and gh actions linters.
1 parent 1e36122 commit e821d7d

File tree

4 files changed

+145
-76
lines changed

4 files changed

+145
-76
lines changed

.github/workflows/ci.yml

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,104 +2,104 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
77

88
jobs:
99
quality:
1010
name: Code Quality
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v5
13+
- name: Checkout code
14+
uses: actions/checkout@v5
1515

16-
- name: Install uv
17-
uses: astral-sh/setup-uv@v3
18-
with:
19-
version: "latest"
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v6
18+
with:
19+
version: "latest"
2020

21-
- name: Set up Python
22-
run: uv python install 3.12
21+
- name: Set up Python
22+
run: uv python install 3.12
2323

24-
- name: Cache pre-commit
25-
uses: actions/cache@v4
26-
with:
27-
path: ~/.cache/pre-commit
28-
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
24+
- name: Cache pre-commit
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.cache/pre-commit
28+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
2929

30-
- name: Install dependencies
31-
run: uv sync --extra dev --extra test
30+
- name: Install dependencies
31+
run: uv sync --extra dev --extra test
3232

33-
- name: Run code quality checks
34-
run: |
35-
echo "🔍 Running all code quality checks..."
36-
uv run pre-commit run --all-files --show-diff-on-failure
33+
- name: Run code quality checks
34+
run: |
35+
echo "🔍 Running all code quality checks..."
36+
uv run pre-commit run --all-files --show-diff-on-failure
3737
3838
test:
3939
name: Test Python 3.12
4040
runs-on: ubuntu-latest
4141
needs: quality
4242

4343
steps:
44-
- name: Checkout code
45-
uses: actions/checkout@v5
44+
- name: Checkout code
45+
uses: actions/checkout@v5
4646

47-
- name: Install uv
48-
uses: astral-sh/setup-uv@v3
49-
with:
50-
version: "latest"
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v6
49+
with:
50+
version: "latest"
5151

52-
- name: Set up Python 3.12
53-
run: uv python install 3.12
52+
- name: Set up Python 3.12
53+
run: uv python install 3.12
5454

55-
- name: Install dependencies
56-
run: uv sync --extra dev --extra test
55+
- name: Install dependencies
56+
run: uv sync --extra dev --extra test
5757

58-
- name: Run tests with coverage
59-
run: |
60-
echo "🧪 Running tests for Python 3.12..."
61-
uv run pytest -v
58+
- name: Run tests with coverage
59+
run: |
60+
echo "🧪 Running tests for Python 3.12..."
61+
uv run pytest -v
6262
63-
- name: Upload coverage to Codecov
64-
uses: codecov/codecov-action@v5
65-
with:
66-
files: ./coverage.xml
67-
flags: unittests
68-
name: codecov-umbrella
69-
fail_ci_if_error: false
63+
- name: Upload coverage to Codecov
64+
uses: codecov/codecov-action@v5
65+
with:
66+
files: ./coverage.xml
67+
flags: unittests
68+
name: codecov-umbrella
69+
fail_ci_if_error: false
7070

7171
build:
7272
name: Build & Verify Package
7373
runs-on: ubuntu-latest
7474
needs: [quality, test]
7575
steps:
76-
- name: Checkout code
77-
uses: actions/checkout@v5
78-
79-
- name: Install uv
80-
uses: astral-sh/setup-uv@v3
81-
with:
82-
version: "latest"
83-
84-
- name: Set up Python
85-
run: uv python install 3.12
86-
87-
- name: Create virtual environment
88-
run: uv venv
89-
90-
- name: Build package
91-
run: |
92-
echo "📦 Building Python package..."
93-
uv build
94-
95-
- name: Verify package installation
96-
run: |
97-
echo "✅ Verifying package can be installed..."
98-
uv pip install dist/*.whl
99-
uv run python -c "import eoapi_notifier; print('Package installed successfully')"
100-
101-
- name: Upload build artifacts
102-
uses: actions/upload-artifact@v4
103-
with:
104-
name: python-package-distributions
105-
path: dist/
76+
- name: Checkout code
77+
uses: actions/checkout@v5
78+
79+
- name: Install uv
80+
uses: astral-sh/setup-uv@v6
81+
with:
82+
version: "latest"
83+
84+
- name: Set up Python
85+
run: uv python install 3.12
86+
87+
- name: Create virtual environment
88+
run: uv venv
89+
90+
- name: Build package
91+
run: |
92+
echo "📦 Building Python package..."
93+
uv build
94+
95+
- name: Verify package installation
96+
run: |
97+
echo "✅ Verifying package can be installed..."
98+
uv pip install dist/*.whl
99+
uv run python -c "import eoapi_notifier; print('Package installed successfully')"
100+
101+
- name: Upload build artifacts
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: python-package-distributions
105+
path: dist/

.pre-commit-config.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ repos:
1010
hooks:
1111
- id: mypy
1212
additional_dependencies: [pydantic>=2.11.7, loguru>=0.7.3, types-PyYAML]
13+
- repo: https://github.com/adrienverge/yamllint.git
14+
rev: v1.37.1
15+
hooks:
16+
- id: yamllint
17+
args: [-c=.yamllint.yaml]
18+
- repo: https://github.com/rhysd/actionlint
19+
rev: v1.7.7
20+
hooks:
21+
- id: actionlint
1322
- repo: local
1423
hooks:
1524
- id: pytest-coverage
@@ -19,4 +28,3 @@ repos:
1928
types: [python]
2029
pass_filenames: false
2130
always_run: true
22-

.yamllint.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
extends: default
2+
3+
rules:
4+
# Allow longer lines for GitHub Actions expressions and commands
5+
line-length:
6+
max: 120
7+
level: warning
8+
9+
# Allow trailing spaces (sometimes needed in YAML multiline strings)
10+
trailing-spaces:
11+
level: warning
12+
13+
# Don't require document start marker (---)
14+
document-start:
15+
present: false
16+
17+
# Be lenient with truthy values (GitHub Actions uses "on", etc.)
18+
truthy:
19+
allowed-values: ['true', 'false', 'on', 'off', 'yes', 'no']
20+
check-keys: false
21+
22+
# Allow multiple spaces after colons (useful for alignment)
23+
colons:
24+
max-spaces-before: -1
25+
max-spaces-after: -1
26+
27+
# Allow multiple consecutive blank lines
28+
empty-lines:
29+
max: 2
30+
max-start: 1
31+
max-end: 1
32+
33+
# Be flexible with indentation in sequences
34+
indentation:
35+
spaces: 2
36+
indent-sequences: true
37+
check-multi-line-strings: false
38+
39+
# Don't enforce key ordering
40+
key-ordering: disable
41+
42+
# Allow duplicate keys in some cases (can be useful in CI contexts)
43+
key-duplicates: enable
44+
45+
# Allow octal values (sometimes used in file permissions)
46+
octal-values:
47+
forbid-implicit-octal: false
48+
49+
ignore: |
50+
# Ignore generated or external files
51+
.venv/
52+
.mypy_cache/
53+
.pytest_cache/
54+
.ruff_cache/
55+
node_modules/
56+
dist/
57+
build/
58+
*.min.yml
59+
*.min.yaml
60+
# Ignore GitHub Actions workflows (handled by actionlint)
61+
.github/workflows/

examples/config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ outputs:
3434
# topic_prefix: "eoapi/"
3535
# qos: 1
3636

37-
# Example with multiple sources and outputs:
37+
# Example with multiple sources and outputs
3838
# sources:
3939
# - type: postgres
4040
# config:
@@ -43,7 +43,7 @@ outputs:
4343
# database: stac_db
4444
# username: notifier
4545
# password: secret123
46-
#
46+
#
4747
# - type: postgres
4848
# config:
4949
# host: db2.example.com
@@ -60,11 +60,11 @@ outputs:
6060
# username: publisher
6161
# password: pub_secret
6262
# use_tls: true
63-
#
63+
#
6464
# # Future: webhook output example
6565
# # - type: webhook
6666
# # config:
6767
# # url: https://api.example.com/notifications
6868
# # headers:
6969
# # Authorization: Bearer token123
70-
# # timeout: 30
70+
# # timeout: 30

0 commit comments

Comments
 (0)