2022-10-26 16:08:20 +02:00
|
|
|
name: 'linters'
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: ['master']
|
|
|
|
paths:
|
|
|
|
- '.github/**'
|
|
|
|
- '**.py'
|
|
|
|
|
|
|
|
jobs:
|
2022-10-21 10:43:33 +02:00
|
|
|
mypy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
- run: pip install mypy
|
|
|
|
- run: pip install types-cryptography types-urllib3
|
|
|
|
- run: pip install distro keyring progressbar zstandard
|
|
|
|
- run: mypy osc
|
|
|
|
|
|
|
|
darker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
- uses: akaihola/darker@1.5.1
|
|
|
|
with:
|
|
|
|
options: "--check --diff --color --line-length=120"
|
|
|
|
src: "."
|
|
|
|
version: "1.5.1"
|
|
|
|
|
2022-10-26 16:08:20 +02:00
|
|
|
pylint_plugins:
|
|
|
|
name: 'Diff pylint runs on osc plugin'
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
plugin_repository:
|
|
|
|
- openSUSE/openSUSE-release-tools
|
|
|
|
- openSUSE/osc-plugin-collab
|
|
|
|
- openSUSE/osc-plugin-install
|
|
|
|
- openSUSE/osc-plugin-overview
|
|
|
|
- openSUSE/osc-plugin-qam
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: 'Install packages'
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y --no-install-recommends install diffutils pylint
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: osc-pr
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.base.sha }}
|
|
|
|
path: osc-master
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: ${{ matrix.plugin_repository }}
|
|
|
|
path: plugin
|
|
|
|
|
|
|
|
- name: 'Diff pylint runs'
|
|
|
|
run: |
|
|
|
|
cd plugin
|
|
|
|
find -maxdepth 2 -name __init__.py | while read i; do dirname $i; done | sort > .pylint-args
|
|
|
|
find -maxdepth 1 -name '*.py' | sort >> .pylint-args
|
|
|
|
PYTHONPATH="../osc-master" pylint --errors-only $(cat .pylint-args) | sort > pylint-osc-master.log || :
|
|
|
|
PYTHONPATH="../osc-pr" pylint --errors-only $(cat .pylint-args) | sort > pylint-osc-pr.log || :
|
|
|
|
diff -u pylint-osc-master.log pylint-osc-pr.log
|