From 2f760bc7fd6b86b5c6758bb4422531f33eab3fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=9A=D0=BE=D0=BC=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <100406268+Timik232@users.noreply.github.com> Date: Thu, 26 Jun 2025 15:25:14 +0300 Subject: [PATCH 1/6] Create pre-commit.yml Github action for pre-commit --- .github/workflows/pre-commit.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..c720358 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,30 @@ +name: Lint with pre-commit + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pre-commit + + - name: Run pre-commit hooks + uses: pre-commit/action@v4.3.0 + with: + extra_args: --all-files From 81bef951a46bc802a4db6defe14e4ed26d5acc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=9A=D0=BE=D0=BC=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <100406268+Timik232@users.noreply.github.com> Date: Thu, 26 Jun 2025 15:26:49 +0300 Subject: [PATCH 2/6] Add checking large files for pre-commit --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b82a034..0386220 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,7 @@ repos: - id: end-of-file-fixer exclude: '.*\.sh$' - id: trailing-whitespace + - id: check-added-large-files - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.5 From 4322ac97fe28b42a950d0f950ccbbbd98d22c89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=9A=D0=BE=D0=BC=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <100406268+Timik232@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:21:06 +0300 Subject: [PATCH 3/6] Remove unnecessary install --- .github/workflows/pre-commit.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index c720358..67140e2 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -19,11 +19,6 @@ jobs: with: python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pre-commit - - name: Run pre-commit hooks uses: pre-commit/action@v4.3.0 with: From ca0f403eb5001722dd3f4f443b41a80114736bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=9A=D0=BE=D0=BC=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <100406268+Timik232@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:22:52 +0300 Subject: [PATCH 4/6] Fix version of the hook --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 67140e2..cd512ee 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -20,6 +20,6 @@ jobs: python-version: '3.x' - name: Run pre-commit hooks - uses: pre-commit/action@v4.3.0 + uses: pre-commit/action@v3.0.1 with: extra_args: --all-files From 479c77ca32bc0d7597eb99c1ae89c16e8f0d0bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=9A=D0=BE=D0=BC=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <100406268+Timik232@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:26:08 +0300 Subject: [PATCH 5/6] Update version for action Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/workflows/pre-commit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index cd512ee..38b0476 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' From 20a567fef95be062d94d3d74e2f248edf2b57dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=9A=D0=BE=D0=BC=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <100406268+Timik232@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:28:14 +0300 Subject: [PATCH 6/6] Update pre-commit for action Remove checking all files --- .github/workflows/pre-commit.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 38b0476..87ac8dc 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -21,5 +21,3 @@ jobs: - name: Run pre-commit hooks uses: pre-commit/action@v3.0.1 - with: - extra_args: --all-files