-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.41 KB
/
pylint.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
name: Pylint
on:
push:
paths:
- 'Weather Processing/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r "Weather Processing/requirements.txt"
- name: Run pylint.
run: |
pylint --fail-under=8.0 "Weather Processing/*.py" > pylint_recommendations.txt
working-directory: ${{ github.workspace }}
continue-on-error: true
- name: Overwrite linting recommendations in README.
run: |
awk '/Here are the linting recommendations/{print; print "```python"; system("cat pylint_recommendations.txt"); print "```"; exit} 1' README.md > README.md.tmp
mv README.md.tmp README.md
working-directory: ${{ github.workspace }}
continue-on-error: true
- name: Commit and push pylint recommendations.
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
git add README.md
git diff-index --quiet HEAD || git commit -m "Update README with latest linting recommendations"
git push
working-directory: ${{ github.workspace }}