Complete workflow fixing

This commit is contained in:
rany2 2023-01-05 01:49:37 +02:00
parent 2c00c63803
commit a1c5924024
6 changed files with 36 additions and 32 deletions

25
.github/workflows/code-quality.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: "Check code quality"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
code-quality:
runs-on: ubuntu-latest
name: "Check code quality"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install all dependencies
run: pip install .[dev]
- name: Run mypy
run: mypy --pretty .
- name: Run isort
run: isort --check-only --diff .
- name: Run black
run: black --check --diff .

View File

@ -1,28 +0,0 @@
name: "Lint"
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.11
architecture: x64
- name: Checkout
uses: actions/checkout@v1
- name: Install mypy
run: pip install mypy
- name: Run mypy
uses: sasanquaneuf/mypy-github-action@releases/v1
with:
checkName: 'mypy' # NOTE: this needs to be the same as the job name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

7
.isort.cfg Normal file
View File

@ -0,0 +1,7 @@
[settings]
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
ensure_newline_before_comments = True
line_length = 88

3
format.sh Executable file
View File

@ -0,0 +1,3 @@
set -eux
find src examples -name '*.py' | xargs black
find src examples -name '*.py' | xargs isort

View File

@ -1,4 +1,2 @@
find src examples -name '*.py' | xargs black
find src examples -name '*.py' | xargs isort
find src examples -name '*.py' | xargs pylint
find src examples -name '*.py' | xargs mypy

View File

@ -12,8 +12,7 @@ from xml.sax.saxutils import escape
import aiohttp
from edge_tts.exceptions import (NoAudioReceived, UnexpectedResponse,
UnknownResponse)
from edge_tts.exceptions import NoAudioReceived, UnexpectedResponse, UnknownResponse
from .constants import WSS_URL