Skip to content

Commit 8a9ab11

Browse files
committed
Add YAML Linter
1 parent c651f90 commit 8a9ab11

File tree

6 files changed

+58
-3
lines changed

6 files changed

+58
-3
lines changed

.github/workflows/changelog-enforcer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
55

66
jobs:
7-
# Enforces the update of a changelog file on every pull request
7+
# Enforces the update of a changelog file on every pull request
88
changelog:
99
runs-on: ubuntu-latest
1010
steps:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Yaml Lint
3+
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
7+
jobs:
8+
validate-YAML:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- id: yaml-lint
13+
name: yaml-lint
14+
uses: ibiqlik/action-yamllint@v3
15+
with:
16+
no_warnings: true
17+
format: colored
18+
config_file: .yamllint.yml
19+
20+
- uses: actions/upload-artifact@v2
21+
if: always()
22+
with:
23+
name: yamllint-logfile
24+
path: ${{ steps.yaml-lint.outputs.logfile }}

.yamllint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
3+
extends: default
4+
5+
rules:
6+
braces:
7+
level: warning
8+
max-spaces-inside: 1
9+
brackets:
10+
level: warning
11+
max-spaces-inside: 1
12+
colons:
13+
level: warning
14+
commas:
15+
level: warning
16+
comments: disable
17+
comments-indentation: disable
18+
document-start: disable
19+
empty-lines:
20+
level: warning
21+
hyphens:
22+
level: warning
23+
indentation:
24+
level: warning
25+
indent-sequences: consistent
26+
line-length:
27+
level: warning
28+
allow-non-breakable-inline-mappings: true
29+
truthy: disable

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
- Added monotonic regridding option
2929
- Make availalbe to History and ExtData2G all supported regridding methods
3030
- Add test cases for ExtData
31+
- Add YAML validator GitHub Action
32+
- This action makes sure all YAML files are valid (to a relaxed standard)
3133

3234
### Changed
3335

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Collections:
22
fstream1: {template: "case1.%y4%m2.nc4", valid_range: "2006-01-01/2007-12-31" }
33
Exports:
4-
VAR2D: {variable: VAR2D, collection: fstream1, sample: {extrapolation: clim}}
4+
VAR2D: {variable: VAR2D, collection: fstream1, sample: {extrapolation: clim}}

Tests/ExtData_Testing_Framework/test_cases/case23/extdata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Samplings:
66
extrapolation: clim
77
source_time: "2016-01-01/2016-12-31"
88
Exports:
9-
VAR2D:
9+
VAR2D:
1010
- {starting: 1970-01-01, variable: VAR2D, collection: fstream1, sample: S1}
1111
- {starting: 2020-01-01, variable: VAR2D, collection: fstream2}

0 commit comments

Comments
 (0)