From a405d19fab5fb1f74125a525e25d360a2fdb583f Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Sun, 28 Jan 2024 03:50:12 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A7=20suggestion:=20Makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..02a5330b --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +.PHONY: lint +lint: + flake8 ./ --exclude .venv,*_pb2.py --max-line-length=150 --ignore=F403,F405,F541 + +.PHONY: format +format: + autopep8 --in-place --aggressive --aggressive --recursive ./ --exclude .venv,*_pb2.py --max-line-length=150 + autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables ./ --exclude .venv From ee2bd8c5dd82de76d7e7903ac4b41109eb0869e0 Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Sun, 28 Jan 2024 03:55:50 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=91=B7=20introduce=20linter=20as=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..3f2018d4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,23 @@ +name: Lint with flake8 +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: 3.10 + - name: Install dependencies + run: | + python -m pip install flake8 + - name: Lint with flake8 + run: | + make lint From def491a3425f881d95bc7dc79e2109b827b3f5f4 Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Sun, 28 Jan 2024 04:20:24 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9D=20add=20memo=20on=20Makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 02a5330b..37576b92 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +# Lint requirements: flake8, autopep8, autoflake +# Run `python -m pip install autopep8 flake8 autoflake` to install them + .PHONY: lint lint: flake8 ./ --exclude .venv,*_pb2.py --max-line-length=150 --ignore=F403,F405,F541