Skip to content

Commit

Permalink
Add yaml linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed May 13, 2024
1 parent b7be0ee commit ec8fc56
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
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
31 changes: 31 additions & 0 deletions .github/workflows/validate_yaml_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---

# Based on code from https://github.com/marketplace/actions/yaml-lint

name: Yaml Lint

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

# This validation is equivalent to running on the command line:
# yamllint -d relaxed --no-warnings
# and is controlled by the .yamllint.yml file
jobs:
validate-YAML:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v4
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 @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added YAML linter

### Changed

### Deprecated
Expand Down

0 comments on commit ec8fc56

Please sign in to comment.