Skip to content

Commit

Permalink
Merge pull request #12 from ingyhere/slim_issue_110
Browse files Browse the repository at this point in the history
NASA-AMMOS/slim#110: Functional Pylint static code analysis. ...
  • Loading branch information
ingyhere authored Mar 15, 2024
2 parents 56919ba + 0b6ee1c commit 71005ba
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to disable certain Pylint checks in the
# "Analyze" configuration block below.
#
# For more information see:
# https://nasa-ammos.github.io/slim/docs/guides/software-lifecycle/application-starter-kits/python-starter-kit/
#
# ******** NOTE ********
# Pylint is a Python-based linter that works to evaluate Python code.
#
name: "Pylint"

on:
push:
branches: [main, develop]
pull_request:
# The branches below must be a subset of the branches above
branches: [develop]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Upgrade tooling
run: |
python3 -m pip install --upgrade pip
pip3 install --upgrade build importlib_metadata setuptools setuptools_scm wheel
pip3 install pylint
- name: Install dependencies
run: |
pip3 install -r requirements.txt
pip3 install -e .
- name: Prepare PYTHONPATH
run: |
src_paths=`find ${PWD} -type f -maxdepth 3 -mindepth 2 -name "*.py" -exec dirname {} + | uniq`
pythonpathplus=""
for p in $src_paths
do
pythonpathplus="${pythonpathplus:+:${pythonpathplus}}:$p"
done
echo "PYTHONPATH=${PYTHONPATH:+:${PYTHONPATH}}${pythonpathplus}:." >> $GITHUB_ENV
- name: Analyze
run: |
# disable docstring checks
# See https://pylint.readthedocs.io/en/latest/user_guide/messages/messages_overview.html
# pylint --disable=C0114,C0115,C0116 --recursive=y --output=pylint_report.txt --exit-zero .
pylint --recursive=y --output=pylint_report.txt --exit-zero .
continue-on-error: true
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: pylint_report
path: pylint_report.txt
if-no-files-found: error
overwrite: true
retention-days: 15

0 comments on commit 71005ba

Please sign in to comment.