Skip to content

Commit

Permalink
ISSUE-2711: yaml lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pinylin committed Nov 15, 2021
1 parent 2cbfa94 commit 9983cb7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Yaml Lint
on: [push]
jobs:
lintAllTheThings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: ./.github/workflows
config_file: .yamllint.yml
8 changes: 8 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: default

rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 80
level: warning
braces: disable
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ ADD_NODES ?= 0
NUM_CPUS ?= 2
TENANT_ID ?= "tenant"
CLUSTER_ID ?= "test"

# yamllint vars
YAML_FILES ?= $(shell find . -path ./target -prune -type f -name '*.yaml' -or -name '*.yml')
YAML_DOCKER_ARGS ?= run --rm --user "$$(id -u)" -v "$${PWD}:/component" --workdir /component
YAMLLINT_ARGS ?= --no-warnings
YAMLLINT_CONFIG ?= .yamllint.yml
YAMLLINT_IMAGE ?= docker.io/cytopia/yamllint:latest
YAMLLINT_DOCKER ?= docker $(YAML_DOCKER_ARGS) $(YAMLLINT_IMAGE)

# Setup dev toolchain
setup:
bash ./scripts/setup/dev_setup.sh
Expand All @@ -17,6 +26,9 @@ lint:
cargo fmt
cargo clippy --tests -- -D warnings

lint-yaml: $(YAML_FILES)
$(YAMLLINT_DOCKER) -f parsable -c $(YAMLLINT_CONFIG) $(YAMLLINT_ARGS) -- $?

miri:
cargo miri setup
MIRIFLAGS="-Zmiri-disable-isolation" cargo miri test
Expand Down

0 comments on commit 9983cb7

Please sign in to comment.