From 3087b801ef9dbf753dd6230685d138ea1545f1b8 Mon Sep 17 00:00:00 2001 From: Adam Janovsky Date: Sat, 4 Feb 2023 09:15:18 +0100 Subject: new lint pipeline --- .github/workflows/new_lint.yml | 41 +++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 11 +++++------ 2 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/new_lint.yml diff --git a/.github/workflows/new_lint.yml b/.github/workflows/new_lint.yml new file mode 100644 index 00000000..0a1a6ca0 --- /dev/null +++ b/.github/workflows/new_lint.yml @@ -0,0 +1,41 @@ +name: Lint (MyPy, Black, Ruff) +on: + push: + workflow_dispatch: +jobs: + black: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Install dependencies + run: pip install -r requirements/dev_requirements.txt + - name: Run Black + run: black + with: + version: "23.1.0" + options: "--check --target-version py38" + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Install dependencies + run: pip install -r requirements/dev_requirements.txt + - name: Run Ruff + run: ruff --format=github . + mypy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Install dependencies + run: pip install -r requirements/dev_requirements.txt + - name: Run Mypy + run: mypy . diff --git a/pyproject.toml b/pyproject.toml index beb1ed33..a7f67db0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,15 +99,12 @@ "F", # pyflakes "C90", # mccabe "UP", # pyupgrade - "PL", # pylint "PTH", # enforce pathlib usage "C4", # comprehensions "SIM", ] ignore = [ - "E501", # line-length, should be handled by black - "PLR2004", # magic numbers, what would a project be without them... - "PLR0913", # too many func arguments + "E501", # line-length, should be handled by black ] src = ["src", "tests"] line-length = 120 @@ -126,19 +123,21 @@ [tool.black] line-length = 120 - exclude = ''' + force-exclude = ''' /( \.git | \.mypy_cache | \.tox | venv - | certsvenv | \.venv | _build | buck-out | build | dist | src/sec_certs/_version.py + | docs + | .ipynb_checkpoints + | .eggs )/ ''' -- cgit v1.3.1