-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (73 loc) · 2.02 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
74
75
76
77
78
79
80
81
# 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: formatting checks
on:
pull_request:
branches: [ "master" ]
jobs:
check_black:
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 black
- name: Code formatting with black
run: |
python -m black . --check
check_flake8:
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 flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
python -m flake8 --config .flake8 --exit-zero
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
check_reuse:
runs-on: ubuntu-latest
steps:
- name: Reuse check
uses: fsfe/reuse-action@v2
check_isort:
runs-on: ubuntu-latest
steps:
- name: isort checks
uses: isort/isort-action@master
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