Skip to content

Automatic commit of package [spacecmd] release [5.0.7-0]. #513

Automatic commit of package [spacecmd] release [5.0.7-0].

Automatic commit of package [spacecmd] release [5.0.7-0]. #513

name: Python checkstyle
on:
push:
branches:
- master
paths:
- '**.py'
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- '**.py'
jobs:
checkstyle:
runs-on: ubuntu-latest
container: registry.opensuse.org/systemsmanagement/uyuni/master/docker/containers_tw/uyuni-master-python:latest
steps:
- uses: actions/checkout@v4
- id: files
uses: Ana06/get-changed-files@v2.3.0
with:
filter: '*.py'
- id: filter-files
run: |
echo added_modified_renamed="$( echo '${{ steps.files.outputs.added_modified_renamed }}' | tr ' ' '\n' | grep -E '^(python|spacewalk|susemanager|containers)/' | tr '\n' ' ')" >> $GITHUB_ENV
- name: Run black on files
run: |
if [[ -z "$added_modified_renamed" ]]; then
echo "no files to check, OK"
else
black --check --diff -t py36 $added_modified_renamed
fi
- name: Run pylint on files
run: |
if [[ -z "$added_modified_renamed" ]]; then
echo "no files to check, OK"
else
pylint --rcfile=/root/.pylintrc $added_modified_renamed
fi