From 527825fa57165414da4e01a07b59545fed334303 Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 23 Oct 2023 00:23:12 +0200 Subject: [PATCH] Improve linting --- .github/workflows/ansible-linting-check.yml | 11 +++++----- .github/workflows/galaxy.yml | 20 ++++++++++-------- .github/workflows/j2lint-check.yml | 22 ++++++++++++++++++++ .github/workflows/yamllint-check.yml | 22 ++++++++++++++++++++ .github/workflows/yamllint.yaml | 23 --------------------- templates/config.j2 | 19 ++++++++++------- 6 files changed, 72 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/j2lint-check.yml create mode 100644 .github/workflows/yamllint-check.yml delete mode 100644 .github/workflows/yamllint.yaml diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml index 0b1268c..1a76d38 100644 --- a/.github/workflows/ansible-linting-check.yml +++ b/.github/workflows/ansible-linting-check.yml @@ -10,14 +10,13 @@ jobs: runs-on: ubuntu-latest steps: - - name: 'checkout git repo' + - name: Checkout git repo uses: actions/checkout@v4 with: - lfs: true - submodules: false + submodules: true fetch-depth: 0 - - name: 'Lint Ansible Playbook' - uses: ansible/ansible-lint-action@v6 + - name: Run ansible-lint + uses: ansible-actions/ansible-lint-action@v1.0.2 with: - path: "." + target: "./" diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml index 4426496..f8beb99 100644 --- a/.github/workflows/galaxy.yml +++ b/.github/workflows/galaxy.yml @@ -1,22 +1,24 @@ --- -name: Galaxy release +name: Galaxy-NG Roles Import # yamllint disable-line rule:truthy on: - push: - branches: ['main'] release: types: ['created'] jobs: build: + name: Galaxy Role Importer runs-on: ubuntu-latest - steps: - - name: 'checkout git repo' - uses: actions/checkout@v4 - - name: 'release on galaxy' - uses: robertdebock/galaxy-action@1.2.1 + steps: + - name: 'Checkout git repo' + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: 'Release on galaxy' + uses: ansible-actions/ansible-galaxy-action@v1.0.1 with: galaxy_api_key: ${{ secrets.galaxy_api_key }} - git_branch: 'main' diff --git a/.github/workflows/j2lint-check.yml b/.github/workflows/j2lint-check.yml new file mode 100644 index 0000000..00c7861 --- /dev/null +++ b/.github/workflows/j2lint-check.yml @@ -0,0 +1,22 @@ +--- +name: Jinja2 Linting check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + name: Jinja2 Linting + runs-on: ubuntu-latest + + steps: + - name: Checkout git repo + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Run j2lint + uses: ansible-actions/j2lint-action@v0.0.1 + with: + target: "./" diff --git a/.github/workflows/yamllint-check.yml b/.github/workflows/yamllint-check.yml new file mode 100644 index 0000000..5e62f57 --- /dev/null +++ b/.github/workflows/yamllint-check.yml @@ -0,0 +1,22 @@ +--- +name: Yamllint check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + name: Yamllint + runs-on: ubuntu-latest + + steps: + - name: Checkout git repo + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Run yamllint + uses: ansible-actions/yamllint-action@v0.0.1 + with: + target: "./" diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml deleted file mode 100644 index 99bb4c4..0000000 --- a/.github/workflows/yamllint.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: 'Yamllint GitHub Actions' - -# yamllint disable-line rule:truthy -on: - push: - branches: '*' - pull_request: - branches: '*' - -jobs: - yamllint: - name: 'Yamllint' - runs-on: ubuntu-latest - steps: - - name: 'checkout git repo' - uses: actions/checkout@v4 - - - name: 'Yamllint' - uses: karancode/yamllint-github-action@v2.1.1 - with: - yamllint_file_or_dir: '.' - yamllint_config_filepath: './.yamllint' diff --git a/templates/config.j2 b/templates/config.j2 index deb0955..6d3f6e9 100644 --- a/templates/config.j2 +++ b/templates/config.j2 @@ -5,7 +5,7 @@ set $term {{ i3_terminal }} # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. font pango:monospace {{ i3_font_size }} -focus_follows_mouse {% if i3_focus_follows_mouse | bool %}yes{% else %}no{% endif %} +focus_follows_mouse {{ i3_focus_follows_mouse | tenary('yes', 'no' ) }} # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod @@ -27,7 +27,7 @@ bindsym $mod+Shift+q kill {% if ansible_distribution == 'Redhat' or ansible_distribution == 'CentOS' %} # bindsym $mod+d exec dmenu_run (a program launcher) bindsym $mod+d exec dmenu_run -{%- else -%} +{% else %} bindsym $mod+d exec rofi -show run # bindsym $mod+d exec rofi (a program launcher) bindsym $mod+Shift+d exec rofi -show drun @@ -114,9 +114,9 @@ bindsym $mod+Shift+{{ workspace.id }} move container to workspace $workspace{{ w {% endfor %} {% for monitor in i3_monitors %} -{% for workspace in monitor.workspaces %} +{% for workspace in monitor.workspaces %} workspace $workspace{{ workspace }} output {{ monitor.output }} -{% endfor %} +{% endfor %} {% endfor %} {% for application in i3_applications %} @@ -170,7 +170,13 @@ bar { } # Setup Monitors -exec_always sleep 1 && xrandr {% for monitor in i3_monitors %} --output {{ monitor.output }} --mode {{ monitor.mode }} --pos {{ monitor.pos }} --rotate {{ monitor.rotate }} {% endfor %} +exec_always sleep 1 && xrandr \ +{% for monitor in i3_monitors %} \ + --output {{ monitor.output }} \ + --mode {{ monitor.mode }} \ + --pos {{ monitor.pos }} \ + --rotate {{ monitor.rotate }} +{% endfor %} # Background {% if i3_desktop_background is defined %} @@ -199,5 +205,4 @@ exec sleep 4 && {{ app }} # Register Keybindings {% for keybinding in i3_keybindings %} bindsym {{ keybinding.key }} exec {{ keybinding.exec }} -{% endfor%} - +{% endfor %}