Skip to content

Commit

Permalink
Add YAML Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Jun 23, 2022
1 parent c651f90 commit 8a9ab11
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog-enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces the update of a changelog file on every pull request
# Enforces the update of a changelog file on every pull request
changelog:
runs-on: ubuntu-latest
steps:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/validate_yaml_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Yaml Lint

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
jobs:
validate-YAML:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: yaml-lint
name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
no_warnings: true
format: colored
config_file: .yamllint.yml

- uses: actions/upload-artifact@v2
if: always()
with:
name: yamllint-logfile
path: ${{ steps.yaml-lint.outputs.logfile }}
29 changes: 29 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---

extends: default

rules:
braces:
level: warning
max-spaces-inside: 1
brackets:
level: warning
max-spaces-inside: 1
colons:
level: warning
commas:
level: warning
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
level: warning
hyphens:
level: warning
indentation:
level: warning
indent-sequences: consistent
line-length:
level: warning
allow-non-breakable-inline-mappings: true
truthy: disable
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added monotonic regridding option
- Make availalbe to History and ExtData2G all supported regridding methods
- Add test cases for ExtData
- Add YAML validator GitHub Action
- This action makes sure all YAML files are valid (to a relaxed standard)

### Changed

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Collections:
fstream1: {template: "case1.%y4%m2.nc4", valid_range: "2006-01-01/2007-12-31" }
Exports:
VAR2D: {variable: VAR2D, collection: fstream1, sample: {extrapolation: clim}}
VAR2D: {variable: VAR2D, collection: fstream1, sample: {extrapolation: clim}}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Samplings:
extrapolation: clim
source_time: "2016-01-01/2016-12-31"
Exports:
VAR2D:
VAR2D:
- {starting: 1970-01-01, variable: VAR2D, collection: fstream1, sample: S1}
- {starting: 2020-01-01, variable: VAR2D, collection: fstream2}

0 comments on commit 8a9ab11

Please sign in to comment.