From 87546976d31066cc22bec0f95f0f6baa5bbea6b4 Mon Sep 17 00:00:00 2001 From: Rust Saiargaliev Date: Fri, 28 Jun 2024 13:55:54 +0200 Subject: [PATCH] Update ruff CI syntax (#481) --- .github/workflows/ci.yml | 2 +- pyproject.toml | 12 +++++------- tests/test_baker.py | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b6f4cd0..f2f9109d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: lint-command: - - ruff --output-format=github . + - ruff check --output-format=github . - black --check --diff . - mypy model_bakery steps: diff --git a/pyproject.toml b/pyproject.toml index 359591c3..14382a40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,9 +94,7 @@ disallow_untyped_calls = true [tool.pytest.ini_options] addopts = "--tb=short -rxs --nomigrations" -[tool.ruff] -target-version = "py38" - +[tool.ruff.lint] select = [ "S", # flake8-bandit "B", # flake8-bugbear @@ -113,19 +111,19 @@ select = [ ignore = ["B904", "E501", "S101", "D1", "D212"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "tests/test_*.py" = [ "S", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] combine-as-imports=true split-on-trailing-comma=true section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"] force-wrap-aliases=true -[tool.ruff.isort.sections] +[tool.ruff.lint.isort.sections] django = ["django"] -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "google" diff --git a/tests/test_baker.py b/tests/test_baker.py index e3bebde3..65323438 100644 --- a/tests/test_baker.py +++ b/tests/test_baker.py @@ -814,7 +814,7 @@ def test_creates_instance_for_model_with_list(self): instance = baker.make(models.BaseModelForList, fk=["foo"]) assert instance.id - assert ["foo"] == instance.fk + assert instance.fk == ["foo"] @pytest.mark.django_db