Debian Codegraph @

.github/workflows/linting.yaml

raw
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.12"
12
13 jobs:
14 ruff:
15 name: Ruff
16 runs-on: ubuntu-latest
17 steps:
18 - name: โคต๏ธ Check out code from GitHub
19 uses: actions/[email protected]
20 - name: ๐Ÿ— Set up Poetry
21 run: pipx install poetry
22 - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }}
23 id: python
24 uses: actions/[email protected]
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: ๐Ÿš€ Run ruff linter
35 run: poetry run ruff check --output-format=github .
36 - name: ๐Ÿš€ Run ruff formatter
37 run: poetry run ruff format --check .
38
39 prek-hooks:
40 name: prek-hooks
41 runs-on: ubuntu-latest
42 steps:
43 - name: โคต๏ธ Check out code from GitHub
44 uses: actions/[email protected]
45 - name: ๐Ÿ— Set up Poetry
46 run: pipx install poetry
47 - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }}
48 id: python
49 uses: actions/[email protected]
50 with:
51 python-version: ${{ env.DEFAULT_PYTHON }}
52 cache: "poetry"
53 - name: ๐Ÿ— Install workflow dependencies
54 run: |
55 poetry config virtualenvs.create true
56 poetry config virtualenvs.in-project true
57 - name: ๐Ÿ— Install Python dependencies
58 run: poetry install --no-interaction
59 - name: ๐Ÿš€ Check Python AST
60 run: poetry run prek run check-ast --all-files
61 - name: ๐Ÿš€ Check for case conflicts
62 run: poetry run prek run check-case-conflict --all-files
63 - name: ๐Ÿš€ Check docstring is first
64 run: poetry run prek run check-docstring-first --all-files
65 - name: ๐Ÿš€ Check that executables have shebangs
66 run: poetry run prek run check-executables-have-shebangs --all-files
67 - name: ๐Ÿš€ Check JSON files
68 run: poetry run prek run check-json --all-files
69 - name: ๐Ÿš€ Check for merge conflicts
70 run: poetry run prek run check-merge-conflict --all-files
71 - name: ๐Ÿš€ Check for broken symlinks
72 run: poetry run prek run check-symlinks --all-files
73 - name: ๐Ÿš€ Check TOML files
74 run: poetry run prek run check-toml --all-files
75 - name: ๐Ÿš€ Check XML files
76 run: poetry run prek run check-xml --all-files
77 - name: ๐Ÿš€ Check YAML files
78 run: poetry run prek run check-yaml --all-files
79 - name: ๐Ÿš€ Detect Private Keys
80 run: poetry run prek run detect-private-key --all-files
81 - name: ๐Ÿš€ Check End of Files
82 run: poetry run prek run end-of-file-fixer --all-files
83 - name: ๐Ÿš€ Trim Trailing Whitespace
84 run: poetry run prek run trailing-whitespace --all-files
85
86 yamllint:
87 name: yamllint
88 runs-on: ubuntu-latest
89 steps:
90 - name: โคต๏ธ Check out code from GitHub
91 uses: actions/[email protected]
92 - name: ๐Ÿ— Set up Poetry
93 run: pipx install poetry
94 - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }}
95 id: python
96 uses: actions/[email protected]
97 with:
98 python-version: ${{ env.DEFAULT_PYTHON }}
99 cache: "poetry"
100 - name: ๐Ÿ— Install workflow dependencies
101 run: |
102 poetry config virtualenvs.create true
103 poetry config virtualenvs.in-project true
104 - name: ๐Ÿ— Install Python dependencies
105 run: poetry install --no-interaction
106 - name: ๐Ÿš€ Run yamllint
107 run: poetry run yamllint .