From 044ba55ea72a4268ba73317c4c5c2b59583bac3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Thu, 4 Nov 2021 07:11:37 +0100 Subject: [PATCH 1/2] Add lint target for running yamllint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders F Björklund --- .yamllint | 12 ++++++++++++ Makefile | 4 ++++ examples/k3s.yaml | 10 +++++----- examples/vmnet.yaml | 2 +- pkg/limayaml/default.yaml | 3 --- 5 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000000..fff5b068474 --- /dev/null +++ b/.yamllint @@ -0,0 +1,12 @@ +--- + +extends: default + +rules: + indentation: + indent-sequences: consistent + truthy: + allowed-values: ['true', 'false', 'on', 'off'] + comments-indentation: disable + document-start: disable + line-length: disable diff --git a/Makefile b/Makefile index 613606a51c1..a80c26e9ed1 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,10 @@ uninstall: "$(DEST)/share/lima" "$(DEST)/share/doc/lima" # TODO: remove $(DEST)/bin/nerdctl only when it is a symlink to nerdctl.lima +.PHONY: lint +lint: + yamllint . + .PHONY: clean clean: rm -rf _output diff --git a/examples/k3s.yaml b/examples/k3s.yaml index 5ecfa7ab671..5dc7cd1d092 100644 --- a/examples/k3s.yaml +++ b/examples/k3s.yaml @@ -12,11 +12,11 @@ # This example requires Lima v0.7.0 or later. images: - # Hint: run `limactl prune` to invalidate the "current" cache - - location: "https://cloud-images.ubuntu.com/impish/current/impish-server-cloudimg-amd64.img" - arch: "x86_64" - - location: "https://cloud-images.ubuntu.com/impish/current/impish-server-cloudimg-arm64.img" - arch: "aarch64" +# Hint: run `limactl prune` to invalidate the "current" cache +- location: "https://cloud-images.ubuntu.com/impish/current/impish-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/impish/current/impish-server-cloudimg-arm64.img" + arch: "aarch64" # Mounts are disabled in this example, but can be enabled optionally. mounts: [] diff --git a/examples/vmnet.yaml b/examples/vmnet.yaml index 24e6a5e48d1..167e8351860 100644 --- a/examples/vmnet.yaml +++ b/examples/vmnet.yaml @@ -17,4 +17,4 @@ networks: # https://github.com/lima-vm/vde_vmnet. Available networks are defined in # $LIMA_HOME/_config/networks.yaml. Supported network types are "host", # "shared", or "bridged". -- lima: shared + - lima: shared diff --git a/pkg/limayaml/default.yaml b/pkg/limayaml/default.yaml index 4e911282710..4869b859577 100644 --- a/pkg/limayaml/default.yaml +++ b/pkg/limayaml/default.yaml @@ -59,8 +59,6 @@ ssh: # Default: false forwardAgent: false - - # ===================================================================== # # ADVANCED CONFIGURATION # ===================================================================== # @@ -234,4 +232,3 @@ useHostResolver: true # ===================================================================== # # END OF TEMPLATE # ===================================================================== # - From 28e26d99efe36f261def38a559936e7ed167b383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 7 Nov 2021 11:50:06 +0100 Subject: [PATCH 2/2] Add yamllint to github test workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders F Björklund --- .github/workflows/test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0fbb6d8fbf..24e5cda9af5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,16 @@ jobs: version: v1.42.1 args: --verbose + yamllint: + runs-on: ubuntu-20.04 + timeout-minutes: 20 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Run yamllint + run: yamllint . + shellcheck: runs-on: ubuntu-20.04 timeout-minutes: 20