mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-01 18:27:18 +00:00
add autofix.ci
This commit is contained in:
parent
e6cb337994
commit
8361c81cdf
6 changed files with 58 additions and 5 deletions
40
.github/workflows/autofix.yml
vendored
Normal file
40
.github/workflows/autofix.yml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: autofix.ci
|
||||
on: [ push, pull_request ]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
autofix:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: install-pinned/pyupgrade@847ef2b8aa35a3817372540b887f4130d864d6b7
|
||||
- name: Run pyupgrade
|
||||
run: |
|
||||
shopt -s globstar
|
||||
export GLOBIGNORE='mitmproxy/contrib/**'
|
||||
pyupgrade --exit-zero-even-if-changed --keep-runtime-typing --py39-plus **/*.py
|
||||
|
||||
- uses: install-pinned/reorder_python_imports@97c3e89c53ae5513cc41716e876e26daff8bbdd6
|
||||
- name: Run reorder-python-imports
|
||||
run: |
|
||||
shopt -s globstar
|
||||
export GLOBIGNORE='mitmproxy/contrib/**'
|
||||
reorder-python-imports --exit-zero-even-if-changed --py39-plus **/*.py
|
||||
- uses: install-pinned/yesqa@b752c9eed899985c6df094e35d7a5a5bd1b94acb
|
||||
|
||||
- name: Run yesqa
|
||||
run: |
|
||||
shopt -s globstar
|
||||
export GLOBIGNORE='mitmproxy/contrib/**'
|
||||
yesqa **/*.py || true
|
||||
- uses: install-pinned/autoflake@fa3c1715169ac36d903ee9d492d64beb5cad331f
|
||||
- run: autoflake --in-place --remove-all-unused-imports --exclude contrib -r .
|
||||
|
||||
- uses: install-pinned/black@81e6dbf82145462d413a6662dd703fa382edeb11
|
||||
- run: black --extend-exclude mitmproxy/contrib .
|
||||
|
||||
- uses: mhils/add-pr-ref-in-changelog@main
|
||||
|
||||
- uses: autofix-ci/action@8bc06253bec489732e5f9c52884c7cace15c0160
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
([#5435](https://github.com/mitmproxy/mitmproxy/issues/5435), @meitinger)
|
||||
* ASGI/WSGI apps can now listen on all ports for a specific hostname.
|
||||
This makes it simpler to accept both HTTP and HTTPS.
|
||||
([#5725](https://github.com/mitmproxy/mitmproxy/pull/5725), @mhils)
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# mitmproxy
|
||||
|
||||
[](https://github.com/mitmproxy/mitmproxy/actions?query=branch%3Amain)
|
||||
[](https://autofix.ci)
|
||||
[](https://codecov.io/gh/mitmproxy/mitmproxy)
|
||||
[](https://pypi.python.org/pypi/mitmproxy)
|
||||
[](https://pypi.python.org/pypi/mitmproxy)
|
||||
|
|
|
|||
|
|
@ -4,9 +4,19 @@ import inspect
|
|||
import textwrap
|
||||
from pathlib import Path
|
||||
|
||||
from mitmproxy import hooks, log, addonmanager
|
||||
from mitmproxy.proxy import server_hooks, layer
|
||||
from mitmproxy.proxy.layers import dns, http, modes, quic, tcp, tls, udp, websocket
|
||||
from mitmproxy import addonmanager
|
||||
from mitmproxy import hooks
|
||||
from mitmproxy import log
|
||||
from mitmproxy.proxy import layer
|
||||
from mitmproxy.proxy import server_hooks
|
||||
from mitmproxy.proxy.layers import dns
|
||||
from mitmproxy.proxy.layers.http import _hooks as http
|
||||
from mitmproxy.proxy.layers import modes
|
||||
from mitmproxy.proxy.layers import quic
|
||||
from mitmproxy.proxy.layers import tcp
|
||||
from mitmproxy.proxy.layers import tls
|
||||
from mitmproxy.proxy.layers import udp
|
||||
from mitmproxy.proxy.layers import websocket
|
||||
|
||||
known = set()
|
||||
|
||||
|
|
|
|||
|
|
@ -87,8 +87,7 @@ class Wrapper:
|
|||
|
||||
service_names = []
|
||||
for service_id in service_ids:
|
||||
scutil_script = 'show Setup:/Network/Service/{}\n'.format(
|
||||
service_id)
|
||||
scutil_script = f"show Setup:/Network/Service/{service_id}\n"
|
||||
stdout = self.run_command_with_input(
|
||||
'/usr/sbin/scutil',
|
||||
scutil_script)
|
||||
|
|
|
|||
|
|
@ -1 +1,3 @@
|
|||
import nonexistent
|
||||
|
||||
nonexistent.foo()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue