forked from MHKiT-Software/MHKiT-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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)" |