-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (40 loc) · 1.31 KB
/
check-code-quality.yml
File metadata and controls
52 lines (40 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0
name: Check Code Quality
on:
# run pipeline from another workflow
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-code-quality
cancel-in-progress: true
jobs:
check-code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install most linters from uv
run: |
uv sync --group lint
- name: Run mypy
run: |
uv run mypy .
- name: Run ruff
run: |
uv run ruff check .
uv run ruff format .
- name: Install and run markdownlint
run: |
npm install -g markdownlint-cli@0.47.0
echo "Running markdownlint"
markdownlint --fix .
- name: If needed raise error
run: |
if [[ `git status --porcelain --untracked-files=no` ]]; then
echo "Formatting not correct! See below the files which need to be reformatted!"
git status --porcelain --untracked-files=no
exit 1
fi