-
Notifications
You must be signed in to change notification settings - Fork 45
34 lines (28 loc) · 1.03 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
name: Pylint Loads
on: [push, pull_request]
jobs:
formatting-and-linting:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Run Pylint on mhkit/loads/ and check score
run: |
# Run pylint and capture the output
pylint_output=$(pylint mhkit/loads/ --output-format=text)
echo "$pylint_output"
# Extract the score from the output
score=$(echo "$pylint_output" | grep "Your code has been rated at" | awk '{print $7}' | sed 's/\/10//')
echo "Pylint score: $score"
# Define the minimum acceptable score
min_score=8.0
# Compare the score with the minimum acceptable score
python -c "import sys; sys.exit(0 if $score >= $min_score else 1)"