From 1495947be88e9ce6d38691639be5b0771aea3fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 29 Aug 2023 22:14:31 +0000 Subject: [PATCH 1/2] Lint Front Matter --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ .yamllint.yml | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .yamllint.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d66c79..de4939b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,3 +37,29 @@ jobs: with: eclint_args: | -exclude=css/* + + lint_front_matter: + name: Lint Front Matter + runs-on: ubuntu-latest + + steps: + - + name: Checkout repository + uses: actions/checkout@v3 + - + name: Cache pip + uses: actions/cache@v3 + with: + path: '~/.cache/pip' + key: '${{ runner.os }}-pip-yamllint' + - + name: Install yamllint + run: pip install --user yamllint + - + name: Remove document contents + run: | + git ls-files -z -- 'src/**.md' | xargs -0 -n 1 -- sed -i -e 'N;P;/---\n$/Q;D' + - + name: Check Front Matter + run: | + git ls-files -z -- 'src/**.md' | xargs -0 -n 1 -- python -m yamllint diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..e719139 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,20 @@ +--- +extends: "default" + +rules: + document-start: + present: true + braces: + forbid: true + brackets: + forbid: false + empty-values: + forbid-in-block-mappings: true + forbid-in-flow-mappings: true + indentation: + spaces: 4 + indent-sequences: false + line-length: false + quoted-strings: + quote-type: "double" + required: true From 7f029f5ecba21b16c5de5c55105d7c728dca64b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 29 Aug 2023 22:17:27 +0000 Subject: [PATCH 2/2] Fix disabling line-length --- .yamllint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamllint.yml b/.yamllint.yml index e719139..2f3aab1 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -14,7 +14,7 @@ rules: indentation: spaces: 4 indent-sequences: false - line-length: false + line-length: "disable" quoted-strings: quote-type: "double" required: true