Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
10 changes: 6 additions & 4 deletions src/euclid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ 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}")