Skip to content

Commit

Permalink
Merge pull request #339 from ergebnis/feature/yaml
Browse files Browse the repository at this point in the history
Enhancement: Lint YAML files
  • Loading branch information
localheinz committed Mar 3, 2020
2 parents 0919a81 + 1c8cf2f commit 5c23088
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 5 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

name: "Integrate"

on:
pull_request:
on: # yamllint disable-line rule:truthy
pull_request: null
push:
branches:
- "master"
Expand Down Expand Up @@ -31,6 +31,13 @@ jobs:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Lint YAML files"
uses: "ibiqlik/action-yamllint@v1"
with:
config_file: ".yamllint.yaml"
file_or_dir: "."
strict: true

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prune.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: "Prune"

on:
on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 12 * * *"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: "Release"

on:
on: # yamllint disable-line rule:truthy
push:
tags:
- "**"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: "Renew"

on:
on: # yamllint disable-line rule:truthy
schedule:
- cron: "1 0 1 1 *"

Expand Down
65 changes: 65 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
extends: "default"

ignore: |
.build/
vendor/
rules:
braces:
max-spaces-inside-empty: 0
max-spaces-inside: 1
min-spaces-inside-empty: 0
min-spaces-inside: 1
brackets:
max-spaces-inside-empty: 0
max-spaces-inside: 0
min-spaces-inside-empty: 0
min-spaces-inside: 0
colons:
max-spaces-after: 1
max-spaces-before: 0
commas:
max-spaces-after: 1
max-spaces-before: 0
min-spaces-after: 1
comments:
ignore-shebangs: true
min-spaces-from-content: 1
require-starting-space: true
comments-indentation: "enable"
document-end:
present: false
document-start:
present: false
indentation:
check-multi-line-strings: true
indent-sequences: true
spaces: 2
empty-lines:
max-end: 0
max-start: 0
max: 1
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
hyphens:
max-spaces-after: 2
key-duplicates: "enable"
key-ordering: "disable"
line-length: "disable"
new-line-at-end-of-file: "enable"
new-lines:
type: "unix"
octal-values:
forbid-implicit-octal: true
quoted-strings:
quote-type: "double"
trailing-spaces: "enable"
truthy:
allowed-values:
- "false"
- "true"

yaml-files:
- '*.yaml'
- '*.yml'
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ code-coverage: vendor ## Collects coverage from running unit tests with phpunit/

.PHONY: coding-standards
coding-standards: vendor ## Fixes code style issues with friendsofphp/php-cs-fixer
yamllint -c .yamllint.yaml --strict .
mkdir -p .build/php-cs-fixer
vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --verbose

Expand Down

0 comments on commit 5c23088

Please sign in to comment.