From 36596adaf7e94023f719b6de8b117df3c051589c Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Mon, 29 May 2023 01:08:36 +0900 Subject: [PATCH] Add pre-commit: black+flake8+pylint --- .github/workflows/pre-commit.yml | 16 ++++++++++++++++ .pre-commit-config.yaml | 19 +++++++++++++++++++ requirements-dev.txt | 1 + 3 files changed, 36 insertions(+) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml create mode 100644 requirements-dev.txt diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..626edc686 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,16 @@ +name: pre-commit + +on: + pull_request: + push: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.9" + cache: 'pip' # caching pip dependencies + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..ea958b7f6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black +- repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 + hooks: + - id: flake8 +- repo: https://github.com/PyCQA/pylint + rev: v2.17.4 + hooks: + - id: pylint diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 000000000..416634f52 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1 @@ +pre-commit