-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (66 loc) · 1.77 KB
/
formatting_checks.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This file is part of pydidas.
#
# Copyright 2024, Helmholtz-Zentrum Hereon
# SPDX-License-Identifier: CC-BY-4.0
#
# This workflow will check the formatting of the newly pushed commits
# to verify that all files are corretly formatted.
name: Check formatting, linting, and copyrights
on:
pull_request:
branches: [ "master" ]
jobs:
check_ruff_formatting:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff
- name: Code formatting with ruff
run: |
python -m ruff format . --check
check_ruff_linting:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff
- name: Lint with ruff
run: |
python -m ruff check .
check_reuse:
runs-on: ubuntu-latest
steps:
- name: Reuse check
uses: fsfe/reuse-action@v2
check_copyrights:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install GitPython
- name: Check copyrights
run: |
python formatter.py --copyright --check --git-only