-
Notifications
You must be signed in to change notification settings - Fork 82
59 lines (55 loc) · 1.66 KB
/
lint.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
name: lint
on:
push:
branches:
- develop
- stable
- 'GSOC**'
pull_request:
branches:
- develop
- stable
- 'GSOC**'
jobs:
flake8:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Lint with flake8
run: |
python -m pip install --upgrade pip
pip install flake8 flake8-builtins
flake8 --count --statistics mslib tests
no-crlf-in-git:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Check for CRLF in the repository
run: |
files_with_crlf="$(git ls-files --eol | awk '$1 ~ "crlf"')"
echo "$files_with_crlf"
[ "$files_with_crlf" == "" ] || exit 1
no-whitespace-issues-in-git:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Check for whitespace issues in the repository
# The two example.txt files need to be excluded because whitespace at EOL is part
# of their format and they fail to parse otherwise.
# The leftover conflict marker warning is ignored for all rst files because
# section headings consisting of 7 "=" characters are mistaken to be part of a
# conflict marker.
run: |
issues="$(
git diff --check $(git hash-object -t tree /dev/null) HEAD :^tests/data/example.txt :^docs/samples/flight-tracks/example.txt |
{ grep -v '^.*\.rst:.*leftover conflict marker$' || true; }
)"
echo "$issues"
[ "$issues" == "" ] || exit 1