48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
name: autofix.ci
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
autofix:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: install-pinned/pyupgrade@28e8d2633f6f1a03d5b4709682ce155a66324e6a
|
|
- name: Run pyupgrade
|
|
run: |
|
|
shopt -s globstar
|
|
export GLOBIGNORE='mitmproxy/contrib/**'
|
|
pyupgrade --exit-zero-even-if-changed --keep-runtime-typing --py310-plus **/*.py
|
|
|
|
- uses: install-pinned/reorder_python_imports@9766e7ba4f33497b107014571afe3b5f4c2d946b
|
|
- name: Run reorder-python-imports
|
|
run: |
|
|
shopt -s globstar
|
|
export GLOBIGNORE='mitmproxy/contrib/**'
|
|
reorder-python-imports --exit-zero-even-if-changed --py310-plus **/*.py
|
|
|
|
- uses: install-pinned/yesqa@4896f663e9c294fddfbf5f4e4fc4f9b1a4556658
|
|
- name: Run yesqa
|
|
run: |
|
|
shopt -s globstar
|
|
export GLOBIGNORE='mitmproxy/contrib/**'
|
|
yesqa **/*.py || true
|
|
|
|
- uses: install-pinned/autoflake@dfa39c5f136f5b885c175734a719dc6ad1f11fc7
|
|
- run: autoflake --in-place --remove-all-unused-imports --exclude mitmproxy/contrib -r .
|
|
|
|
- uses: install-pinned/black@3375665f712256be11c3212db472c3dafc217fa1
|
|
- run: black --extend-exclude mitmproxy/contrib .
|
|
|
|
- uses: mhils/add-pr-ref-in-changelog@main
|
|
|
|
- uses: autofix-ci/action@8bc06253bec489732e5f9c52884c7cace15c0160
|