From d1ba6dfa4ed785eb3fd6cf1d63d7d6f329e4e885 Mon Sep 17 00:00:00 2001 From: Kirill Morozov Date: Tue, 12 Mar 2024 23:40:30 +0200 Subject: [PATCH] ci: add lint job (#20) Lint YAML files using yamllint with default configuration. --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ .github/workflows/pr.yml | 1 + Taskfile.yml | 12 ++++++++++++ alacritty/alacritty.yml | 3 ++- alacritty/rose-pine-dawn.yml | 1 + alacritty/rose-pine-moon.yml | 1 + alacritty/rose-pine.yml | 1 + 7 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1ce3feb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +--- +name: CI +# yamllint disable-line rule:truthy +on: + - pull_request + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + + - name: Install Task + uses: arduino/setup-task@v2.0.0 + with: + version: 3.x + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Run lint task + run: task lint diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3eb077b..6ca492d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,5 +1,6 @@ --- name: PR +# yamllint disable-line rule:truthy on: - pull_request diff --git a/Taskfile.yml b/Taskfile.yml index 17c8722..66ad1bf 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -18,6 +18,7 @@ tasks: cmds: - curl -sS https://starship.rs/install.sh | sh + # yamllint disable-line rule:key-duplicates install-starship: desc: Install starship platforms: [darwin] @@ -31,6 +32,7 @@ tasks: status: - '[ -d ~/.oh-my-zsh ]' cmds: + # yamllint disable-line rule:line-length - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" link-file: @@ -133,3 +135,13 @@ tasks: - task: clean-alacritty - task: clean-helix - task: clean-neovim + + lint-yaml: + desc: Lint YAML files using yamllint + aliases: + - lint + preconditions: + - sh: yamllint --version + msg: yamllint is not installed + cmds: + - yamllint . diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml index b85212d..1c2275e 100644 --- a/alacritty/alacritty.yml +++ b/alacritty/alacritty.yml @@ -1,7 +1,8 @@ +--- font: normal: family: Fira Code size: 12.0 import: - - ~/.config/alacritty/rose-pine.yml + - ~/.config/alacritty/rose-pine.yml diff --git a/alacritty/rose-pine-dawn.yml b/alacritty/rose-pine-dawn.yml index 56cb0fb..d31bbd5 100644 --- a/alacritty/rose-pine-dawn.yml +++ b/alacritty/rose-pine-dawn.yml @@ -1,3 +1,4 @@ +--- colors: primary: background: "0xfaf4ed" diff --git a/alacritty/rose-pine-moon.yml b/alacritty/rose-pine-moon.yml index 517584d..d791206 100644 --- a/alacritty/rose-pine-moon.yml +++ b/alacritty/rose-pine-moon.yml @@ -1,3 +1,4 @@ +--- colors: primary: background: "0x232136" diff --git a/alacritty/rose-pine.yml b/alacritty/rose-pine.yml index ed70851..4c74afc 100644 --- a/alacritty/rose-pine.yml +++ b/alacritty/rose-pine.yml @@ -1,3 +1,4 @@ +--- colors: primary: background: "0x191724"