|
| 1 | +--- |
| 2 | +name: Linting |
| 3 | + |
| 4 | +# yamllint disable-line rule:truthy |
| 5 | +on: |
| 6 | + push: |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +env: |
| 11 | + DEFAULT_PYTHON: "3.11" |
| 12 | + |
| 13 | +jobs: |
| 14 | + codespell: |
| 15 | + name: codespell |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: ⤵️ Check out code from GitHub |
| 19 | + |
| 20 | + - name: 🏗 Set up Poetry |
| 21 | + run: pipx install poetry |
| 22 | + - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} |
| 23 | + id: python |
| 24 | + |
| 25 | + with: |
| 26 | + python-version: ${{ env.DEFAULT_PYTHON }} |
| 27 | + cache: "poetry" |
| 28 | + - name: 🏗 Install workflow dependencies |
| 29 | + run: | |
| 30 | + poetry config virtualenvs.create true |
| 31 | + poetry config virtualenvs.in-project true |
| 32 | + - name: 🏗 Install Python dependencies |
| 33 | + run: poetry install --no-interaction |
| 34 | + - name: 🚀 Check code for common misspellings |
| 35 | + run: poetry run pre-commit run codespell --all-files |
| 36 | + |
| 37 | + ruff: |
| 38 | + name: Ruff |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - name: ⤵️ Check out code from GitHub |
| 42 | + |
| 43 | + - name: 🏗 Set up Poetry |
| 44 | + run: pipx install poetry |
| 45 | + - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} |
| 46 | + id: python |
| 47 | + |
| 48 | + with: |
| 49 | + python-version: ${{ env.DEFAULT_PYTHON }} |
| 50 | + cache: "poetry" |
| 51 | + - name: 🏗 Install workflow dependencies |
| 52 | + run: | |
| 53 | + poetry config virtualenvs.create true |
| 54 | + poetry config virtualenvs.in-project true |
| 55 | + - name: 🏗 Install Python dependencies |
| 56 | + run: poetry install --no-interaction |
| 57 | + - name: 🚀 Run ruff linter |
| 58 | + run: poetry run ruff check --output-format=github . |
| 59 | + - name: 🚀 Run ruff formatter |
| 60 | + run: poetry run ruff format --check . |
| 61 | + |
| 62 | + pre-commit-hooks: |
| 63 | + name: pre-commit-hooks |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - name: ⤵️ Check out code from GitHub |
| 67 | + |
| 68 | + - name: 🏗 Set up Poetry |
| 69 | + run: pipx install poetry |
| 70 | + - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} |
| 71 | + id: python |
| 72 | + |
| 73 | + with: |
| 74 | + python-version: ${{ env.DEFAULT_PYTHON }} |
| 75 | + cache: "poetry" |
| 76 | + - name: 🏗 Install workflow dependencies |
| 77 | + run: | |
| 78 | + poetry config virtualenvs.create true |
| 79 | + poetry config virtualenvs.in-project true |
| 80 | + - name: 🏗 Install Python dependencies |
| 81 | + run: poetry install --no-interaction |
| 82 | + - name: 🚀 Check Python AST |
| 83 | + run: poetry run pre-commit run check-ast --all-files |
| 84 | + - name: 🚀 Check for case conflicts |
| 85 | + run: poetry run pre-commit run check-case-conflict --all-files |
| 86 | + - name: 🚀 Check docstring is first |
| 87 | + run: poetry run pre-commit run check-docstring-first --all-files |
| 88 | + - name: 🚀 Check that executables have shebangs |
| 89 | + run: poetry run pre-commit run check-executables-have-shebangs --all-files |
| 90 | + - name: 🚀 Check JSON files |
| 91 | + run: poetry run pre-commit run check-json --all-files |
| 92 | + - name: 🚀 Check for merge conflicts |
| 93 | + run: poetry run pre-commit run check-merge-conflict --all-files |
| 94 | + - name: 🚀 Check for broken symlinks |
| 95 | + run: poetry run pre-commit run check-symlinks --all-files |
| 96 | + - name: 🚀 Check TOML files |
| 97 | + run: poetry run pre-commit run check-toml --all-files |
| 98 | + - name: 🚀 Check YAML files |
| 99 | + run: poetry run pre-commit run check-yaml --all-files |
| 100 | + - name: 🚀 Detect Private Keys |
| 101 | + run: poetry run pre-commit run detect-private-key --all-files |
| 102 | + - name: 🚀 Check End of Files |
| 103 | + run: poetry run pre-commit run end-of-file-fixer --all-files |
| 104 | + - name: 🚀 Trim Trailing Whitespace |
| 105 | + run: poetry run pre-commit run trailing-whitespace --all-files |
| 106 | + |
| 107 | + pylint: |
| 108 | + name: pylint |
| 109 | + runs-on: ubuntu-latest |
| 110 | + steps: |
| 111 | + - name: ⤵️ Check out code from GitHub |
| 112 | + |
| 113 | + - name: 🏗 Set up Poetry |
| 114 | + run: pipx install poetry |
| 115 | + - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} |
| 116 | + id: python |
| 117 | + |
| 118 | + with: |
| 119 | + python-version: ${{ env.DEFAULT_PYTHON }} |
| 120 | + cache: "poetry" |
| 121 | + - name: 🏗 Install workflow dependencies |
| 122 | + run: | |
| 123 | + poetry config virtualenvs.create true |
| 124 | + poetry config virtualenvs.in-project true |
| 125 | + - name: 🏗 Install Python dependencies |
| 126 | + run: poetry install --no-interaction |
| 127 | + - name: 🚀 Run pylint |
| 128 | + run: poetry run pre-commit run pylint --all-files |
| 129 | + |
| 130 | + yamllint: |
| 131 | + name: yamllint |
| 132 | + runs-on: ubuntu-latest |
| 133 | + steps: |
| 134 | + - name: ⤵️ Check out code from GitHub |
| 135 | + |
| 136 | + - name: 🏗 Set up Poetry |
| 137 | + run: pipx install poetry |
| 138 | + - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} |
| 139 | + id: python |
| 140 | + |
| 141 | + with: |
| 142 | + python-version: ${{ env.DEFAULT_PYTHON }} |
| 143 | + cache: "poetry" |
| 144 | + - name: 🏗 Install workflow dependencies |
| 145 | + run: | |
| 146 | + poetry config virtualenvs.create true |
| 147 | + poetry config virtualenvs.in-project true |
| 148 | + - name: 🏗 Install Python dependencies |
| 149 | + run: poetry install --no-interaction |
| 150 | + - name: 🚀 Run yamllint |
| 151 | + run: poetry run yamllint . |
| 152 | + |
| 153 | + prettier: |
| 154 | + name: Prettier |
| 155 | + runs-on: ubuntu-latest |
| 156 | + steps: |
| 157 | + - name: ⤵️ Check out code from GitHub |
| 158 | + |
| 159 | + - name: 🏗 Set up Poetry |
| 160 | + run: pipx install poetry |
| 161 | + - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} |
| 162 | + id: python |
| 163 | + |
| 164 | + with: |
| 165 | + python-version: ${{ env.DEFAULT_PYTHON }} |
| 166 | + cache: "poetry" |
| 167 | + - name: 🏗 Install workflow dependencies |
| 168 | + run: | |
| 169 | + poetry config virtualenvs.create true |
| 170 | + poetry config virtualenvs.in-project true |
| 171 | + - name: 🏗 Install Python dependencies |
| 172 | + run: poetry install --no-interaction |
| 173 | + - name: 🏗 Set up Node.js |
| 174 | + |
| 175 | + with: |
| 176 | + node-version-file: ".nvmrc" |
| 177 | + cache: "npm" |
| 178 | + - name: 🏗 Install NPM dependencies |
| 179 | + run: npm install |
| 180 | + - name: 🚀 Run prettier |
| 181 | + run: poetry run pre-commit run prettier --all-files |
0 commit comments