From ea80a6ca19575680fba108551953fa2d083db811 Mon Sep 17 00:00:00 2001 From: Dan Moore Date: Mon, 18 Mar 2024 11:07:56 -0400 Subject: [PATCH] `ruff`: GH Action and Reformat Files (#269) * Update `ruff` CLI parameter Eliminates `warning: `ruff ` is deprecated. Use `ruff check ` instead.` as seen at https://github.com/bennylope/django-organizations/actions/runs/8222756016/job/22484618015#step:5:14 * Reformatting a few files with `ruff` --- .github/workflows/lint.yml | 2 +- example/conf/wsgi.py | 1 + noxfile.py | 1 + src/organizations/backends/modeled.py | 1 + tests/backends/__init__.py | 4 +--- tests/test_fields.py | 1 + 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index de9ff54..6f20955 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,6 +19,6 @@ jobs: run: pip install .[linting] - name: Run flake8 run: | - ruff . + ruff check . ruff format --check . isort src/organizations --check --diff diff --git a/example/conf/wsgi.py b/example/conf/wsgi.py index 09ab39e..d068c38 100644 --- a/example/conf/wsgi.py +++ b/example/conf/wsgi.py @@ -13,6 +13,7 @@ framework. """ + import os from django.core.wsgi import get_wsgi_application diff --git a/noxfile.py b/noxfile.py index 9bdf542..cc709d1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -3,6 +3,7 @@ Several nox tasks copied from the pipx project, Copyright (c) 2018 Chad Smith """ + import os import subprocess diff --git a/src/organizations/backends/modeled.py b/src/organizations/backends/modeled.py index df13ee4..711d0fc 100644 --- a/src/organizations/backends/modeled.py +++ b/src/organizations/backends/modeled.py @@ -1,6 +1,7 @@ """ Invitations that use an invitation model """ + import email.utils from typing import List # noqa from typing import Optional # noqa diff --git a/tests/backends/__init__.py b/tests/backends/__init__.py index 8062daa..bc68a39 100644 --- a/tests/backends/__init__.py +++ b/tests/backends/__init__.py @@ -1,3 +1 @@ -""" - -""" +""" """ diff --git a/tests/test_fields.py b/tests/test_fields.py index 44870ba..5290d2b 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -1,6 +1,7 @@ """ Tests for configurable fields """ + import importlib from django.core.exceptions import ImproperlyConfigured