-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (115 loc) · 4.29 KB
/
linter.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
name: Linter
on:
push:
pull_request:
jobs:
flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version-file: .python-version
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip wheel flake8
# python3 -m pip install -r requirements.txt
# upgrade all installed packages to their latest versions
# python3 -m pip list --format=freeze --outdated | cut -d '=' -f1 | xargs -n1 python3 -m pip install --upgrade
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --show-source --statistics
mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version-file: .python-version
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip wheel mypy
python3 -m pip install -r requirements.txt
- name: Lint with mypy
run: |
mkdir -p .mypy_cache
mypy --install-types --non-interactive
pylint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version-file: .python-version
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip wheel pylint
python3 -m pip install -r requirements.txt
cat atlasserver/settings_test.txt >> atlasserver/settings.py
python -m pip install -e .
- name: Lint with pylint
run: pylint atlasserver
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version-file: .python-version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff
run: ruff check --output-format=github .
- name: Run Ruff Format
run: ruff format --check .
superlinter:
name: Super linter
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version: 3.10.6
- name: Create .env
run: |
touch .env
- name: Lint Code Base
uses: github/super-linter/slim@v4
env:
LINTER_RULES_PATH: ./
FILTER_REGEX_EXCLUDE: .*/lightcurveplotly.js
# LOG_LEVEL: WARNING
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
PYTHON_MYPY_CONFIG_FILE: pyproject.toml
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_MYPY: false
VALIDATE_BASH: false
VALIDATE_CSS: false
VALIDATE_HTML: false # can't understand Django templates
VALIDATE_GITLEAKS: false
VALIDATE_JSCPD: false
VALIDATE_PYTHON_ISORT: false
YAML_ERROR_ON_WARNING: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}