diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..56c2ac4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,19 @@ +name: Ruff +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: "3.13.7" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ruff pytest + - name: Run Ruff + run: ruff check --output-format=github . + - name: Run unit-tests + run: python -m pytest tests/* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..098a5bd --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[tool.ruff.lint] + extend-select = [ + "F", # Правила Pyflakes + "W", # Предупреждения PyCodeStyle + "E", # Ошибки PyCodeStyle + "I", # Правильно сортировать импорты + "N", # Нейминг + "UP", # Предупреждать, если что-то можно изменить из-за новых версий Python + "C4", # Ловить неправильное использование comprehensions, dict, list и т.д. + "FA", # Применять from future import annotations + "ISC", # Хорошее использование конкатенации строк + "ICN", # Использовать общие соглашения об импорте + "RET", # Хорошие практики возврата + "SIM", # Общие правила упрощения + ] diff --git a/tests/conftest.py b/tests/conftest.py index 2285f0a..d28a7a3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,7 @@ -import pytest import random +import pytest + @pytest.fixture def random_array(): diff --git a/tests/heap_sort.py b/tests/heap_sort.py index 59929f2..b9e12c8 100644 --- a/tests/heap_sort.py +++ b/tests/heap_sort.py @@ -1,4 +1,5 @@ import pytest + from src.heap_sort import heap_sort