Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Yamllint
on: [pull_request]
jobs:
yamllint:
name: Yamllint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Yamllint
uses: karancode/yamllint-github-action@master
with:
yamllint_strict: false
yamllint_config_filepath: .yamllint.yml
yamllint_comment: true
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .yamlfix.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# base.toml
allow_duplicate_keys = false
line_length = 100
preserve_quotes = true
sequence_style = "block_style"
11 changes: 11 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
extends: default
rules:
comments: enable
line-length: disable
empty-lines: disable
ignore: |-
.git
.tox
secrets.yml
secrets-*.yml
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
venv = . venv/bin/activate
export PATH := ${PATH}:${PWD}/venv/bin
basedir = ${PWD}

VAULTPASS_FILE ?= ${PWD}/secrets/vaultpass

Expand Down Expand Up @@ -29,6 +30,23 @@ venv/bin/activate: Makefile requirements.txt
@${venv} && pip3 install -r requirements.txt
touch venv/bin/activate

#################################################
### EXPERIMENTAL, yamlfix is still very broken

.PHONY: lint-check
lint-check: deps
$(MAKE) lint-fix DO_CHECK="--check"

# Just for testing, currently yamllint seems to be broken
.PHONY: lint-fix
lint-fix: deps
${venv} && find . -type f \( -not -path "misc/node-images/node-image/*" -and -not -path "*/.venv/*" -and -not -path "*/venv/*" -regex ".*\.ya?ml" \) \
-print \
-exec yamlfix --verbose ${DO_CHECK} --config-file ${basedir}/.yamlfix.toml {} \;

### EXPERIMENTAL
#################################################

.PHONY: deps
sync: deps
@[ "${BRANCH}" ] && sed -i -e "s/version: .*/version: ${BRANCH}/" gilt.yml || exit 0
Expand Down Expand Up @@ -110,3 +128,4 @@ endif
.PHONY: ansible_vault_encrypt_string
ansible_vault_encrypt_string: deps check_vault_pass
@${venv} && ansible-vault encrypt_string --vault-password-file ${VAULTPASS_FILE}

Loading