From 404703f5793fbdf07bb23282c2e5efa9d5170c94 Mon Sep 17 00:00:00 2001 From: ialina07 Date: Sat, 6 Dec 2025 17:59:05 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20ruff=20=D0=B2?= =?UTF-8?q?=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cac796c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "your-project" +version = "0.1.0" +requires-python = ">=3.8" + +[tool.ruff] +target-version = "py311" +line-length = 100 +cache-dir = ".ruff_cache" +select = ["E", "W", "F", "I", "N", "UP", "B", "C4", "SIM", "ARG"] +ignore = ["E501"] + +[tool.ruff.per-file-ignores] +"__init__.py" = ["F401"] +"tests/**/*.py" = ["S101", "SLF001"] +"**/migrations/**/*.py" = ["ALL"] + +[tool.ruff.format] +indent-style = "space" +quote-style = "double" + +[tool.pytest.ini_options] +testpaths = ["tests"] +addopts = ["-v", "--tb=short"] +python_files = ["test_*.py"] From c9a9be85461abc379ed8451bf4690fdac5733d11 Mon Sep 17 00:00:00 2001 From: ialina07 Date: Sun, 7 Dec 2025 11:23:46 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20.github/workflows/ruff.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ruff.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/ruff.yml diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 0000000..1a76151 --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,35 @@ +name: Ruff Code Quality Check + +on: [ push, pull_request ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ruff: + name: Ruff Check + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install Ruff + run: | + pip install ruff + + - name: Run Ruff check + run: | + ruff check . --output-format=github + + - name: Check code formatting + run: | + ruff format --check . --diff From bd0a24e7c7284f1fc825e4fd8147f2b42a1fc646 Mon Sep 17 00:00:00 2001 From: ialina07 Date: Sun, 7 Dec 2025 11:31:50 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=D0=B0=20euclid.py=20=D1=81=D0=BE=D0=B3=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=82=D1=80=D0=B5=D0=B1=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=D0=BC=20ruff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/euclid.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/euclid.py b/src/euclid.py index 6e2e340..8e10ac7 100644 --- a/src/euclid.py +++ b/src/euclid.py @@ -2,10 +2,11 @@ def evkl(a, b): if a == 0: return b, 0, 1 else: - nod, x, y= evkl(b%a, a) - return nod, y-(b//a)*x, x + nod, x, y = evkl(b % a, a) + return nod, y - (b // a) * x, x + a = int(input()) b = int(input()) nod, x, y = evkl(a, b) -print(f'НОД({a}, {b}) = {nod}') -print(f'линейная комбинация: {a}*{x} + {b}*{y} = {nod}') +print(f"НОД({a}, {b}) = {nod}") +print(f"линейная комбинация: {a}*{x} + {b}*{y} = {nod}") From c9f6a3884d8a4de49b8f8f9995aebb285c359e48 Mon Sep 17 00:00:00 2001 From: ialina07 Date: Sun, 7 Dec 2025 11:55:21 +0000 Subject: [PATCH 4/4] Fix formatting --- src/euclid.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/euclid.py b/src/euclid.py index 8e10ac7..ef06357 100644 --- a/src/euclid.py +++ b/src/euclid.py @@ -5,6 +5,7 @@ def evkl(a, b): nod, x, y = evkl(b % a, a) return nod, y - (b // a) * x, x + a = int(input()) b = int(input()) nod, x, y = evkl(a, b)