From 4e4726c71c60b93ba41c6c11c55e6c036d0b3674 Mon Sep 17 00:00:00 2001 From: Dowon Date: Tue, 27 Feb 2024 21:58:41 +0900 Subject: [PATCH] ci: add lint action --- .github/workflows/lint.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 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 0000000..405efe5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,35 @@ +name: Lint + +on: + pull_request: + paths: + - "**.py" + +jobs: + lint: + runs-on: ubuntu-latest + if: github.repository == 'Bing-su/adetailer' || github.repository == '' + + steps: + - uses: actions/checkout@v4 + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install python packages + run: pip install black ruff pre-commit-hooks + + - name: Run pre-commit-hooks + run: | + check-ast + trailing-whitespace-fixer --markdown-linebreak-ext=md + end-of-file-fixer + mixed-line-ending + + - name: Run black + run: black --check . + + - name: Run ruff + run: ruff check .