Skip to content

Commit fb4d9d8

Browse files
committed
added pylint gh actions workflow
1 parent c2cbae3 commit fb4d9d8

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/pylint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Pylint Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
pylint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.12'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install pylint
26+
27+
- name: Run pylint and save output
28+
id: pylint
29+
run: |
30+
pylint moddata > pylint_output.txt || true
31+
echo "::set-output name=score::$(pylint moddata --score=y --exit-zero | grep 'Your code has been rated at' | sed 's/.*rated at \([0-9\.]*\).*/\1/')"
32+
cat pylint_output.txt
33+
34+
- name: Check pylint score
35+
if: steps.pylint.outputs.score < 9
36+
run: |
37+
echo "Pylint score below 9, failing workflow."
38+
exit 1

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
![CI](https://github.com/wegar-2/moddata/actions/workflows/python-tests.yml/badge.svg)
44
![codecov](https://codecov.io/gh/wegar-2/moddata/branch/main/graph/badge.svg)
55
![Lint](https://github.com/wegar-2/moddata/actions/workflows/lint.yml/badge.svg)
6+
![Pylint Check](https://github.com/wegar-2/moddata/actions/workflows/pylint.yml/badge.svg)
7+
68

79
Provides data for use in modeling.
810

0 commit comments

Comments
 (0)