From 95b34564ec9a36dc65079b10afac7984475baab8 Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Sun, 10 Oct 2021 02:22:34 +0800 Subject: [PATCH] ci: run linter --- .github/workflows/main.yml | 2 ++ Makefile | 10 ++++++++-- dev-requirements.txt | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3710693..ac440a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,6 +23,8 @@ jobs: git config user.email "actions@users.noreply.github.com" - name: Test run: coverage run -m pytest + - name: Lint + run: make lint - name: Update(master) if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }} env: diff --git a/Makefile b/Makefile index 846f6c2..3d3c6ed 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,14 @@ default: format +ifeq ($(OS),Windows_NT) +PYTHON?=py -3.8 +else +PYTHON?=python3 +endif + lint: - py -3.8 -m black -t py38 --check --diff . + $(PYTHON) -m black -t py38 --check --diff . format: - py -3.8 -m black -t py38 . + $(PYTHON) -m black -t py38 . diff --git a/dev-requirements.txt b/dev-requirements.txt index 11e3ab6..b07d2fd 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,2 +1,3 @@ pytest==6.2.5 coverage==5.5 +black==21.5b2