🚨(backend) follow Ruff 2024.2 style introduced in v0.3.0

We recently updated Ruff from 0.2.2 to v0.3, which introduced
Ruff 2024.2 style. This new style updated Ruff formatter's behavior,
making our make lint command fails.

Ruff 2024.2 style add a blank line after the module docstring.
Please take a look at Ruff ChangeLog to get more info.
This commit is contained in:
Lebaud Antoine
2024-03-07 10:57:05 +01:00
committed by aleb_the_flash
parent dad81c8d73
commit 5ec0dcf206
36 changed files with 41 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
"""Admin classes and registrations for People's core app."""
from django import forms
from django.contrib import admin
from django.contrib.auth import admin as auth_admin

View File

@@ -1,4 +1,5 @@
"""People core API endpoints"""
from django.conf import settings
from django.core.exceptions import ValidationError

View File

@@ -1,4 +1,5 @@
"""Permission handlers for the People core app."""
from django.core import exceptions
from rest_framework import permissions

View File

@@ -1,4 +1,5 @@
"""Client serializers for the People core app."""
from rest_framework import exceptions, serializers
from timezone_field.rest_framework import TimeZoneSerializerField

View File

@@ -1,4 +1,5 @@
"""API endpoints"""
from django.contrib.postgres.search import TrigramSimilarity
from django.db.models import Func, Max, OuterRef, Prefetch, Q, Subquery, Value

View File

@@ -1,4 +1,5 @@
"""Authentication for the People core app."""
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.db import models

View File

@@ -1,6 +1,7 @@
"""
Core application enums declaration
"""
from django.conf import global_settings, settings
from django.utils.translation import gettext_lazy as _

View File

@@ -2,6 +2,7 @@
"""
Core application factories
"""
from django.conf import settings
from django.contrib.auth.hashers import make_password

View File

@@ -1,6 +1,7 @@
"""
Declare and configure the models for the People core application
"""
import json
import os
import uuid

View File

@@ -1,6 +1,7 @@
"""
Test suite for generated openapi schema.
"""
import json
from io import StringIO

View File

@@ -1,6 +1,7 @@
"""
Test for team accesses API endpoints in People's core app : create
"""
import random
import pytest

View File

@@ -1,6 +1,7 @@
"""
Test for team accesses API endpoints in People's core app : delete
"""
import random
import pytest

View File

@@ -1,6 +1,7 @@
"""
Test for team accesses API endpoints in People's core app : list
"""
import pytest
from rest_framework.test import APIClient

View File

@@ -1,6 +1,7 @@
"""
Test for team accesses API endpoints in People's core app : retrieve
"""
import pytest
from rest_framework.test import APIClient

View File

@@ -1,6 +1,7 @@
"""
Test for team accesses API endpoints in People's core app : update
"""
import random
from uuid import uuid4

View File

@@ -1,6 +1,7 @@
"""
Tests for Teams API endpoint in People's core app: create
"""
import pytest
from rest_framework.status import (
HTTP_201_CREATED,

View File

@@ -1,6 +1,7 @@
"""
Tests for Teams API endpoint in People's core app: delete
"""
import pytest
from rest_framework.status import (
HTTP_204_NO_CONTENT,

View File

@@ -1,6 +1,7 @@
"""
Tests for Teams API endpoint in People's core app: list
"""
from unittest import mock
import pytest

View File

@@ -1,6 +1,7 @@
"""
Tests for Teams API endpoint in People's core app: retrieve
"""
import pytest
from rest_framework.status import HTTP_200_OK, HTTP_401_UNAUTHORIZED, HTTP_404_NOT_FOUND
from rest_framework.test import APIClient

View File

@@ -1,6 +1,7 @@
"""
Tests for Teams API endpoint in People's core app: update
"""
import random
import pytest

View File

@@ -1,6 +1,7 @@
"""
Test contacts API endpoints in People's core app.
"""
from django.test.utils import override_settings
import pytest

View File

@@ -1,6 +1,7 @@
"""
Test users API endpoints in the People core app.
"""
from unittest import mock
import pytest

View File

@@ -192,9 +192,12 @@ def test_models_oidc_user_getter_invalid_token(django_assert_num_queries, monkey
monkeypatch.setattr(OIDCAuthenticationBackend, "get_userinfo", get_userinfo_mocked)
with django_assert_num_queries(0), pytest.raises(
SuspiciousOperation,
match="User info contained no recognizable user identification",
with (
django_assert_num_queries(0),
pytest.raises(
SuspiciousOperation,
match="User info contained no recognizable user identification",
),
):
klass.get_or_create_user(access_token="test-token", id_token=None, payload=None)

View File

@@ -1,6 +1,7 @@
"""
Unit tests for the Contact model
"""
from django.core.exceptions import ValidationError
import pytest

View File

@@ -1,6 +1,7 @@
"""
Unit tests for the Identity model
"""
from django.core.exceptions import ValidationError
import pytest

View File

@@ -1,6 +1,7 @@
"""
Unit tests for the Invitation model
"""
from django.core.exceptions import ValidationError
import pytest

View File

@@ -1,6 +1,7 @@
"""
Unit tests for the TeamAccess model
"""
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ValidationError

View File

@@ -1,6 +1,7 @@
"""
Unit tests for the Team model
"""
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ValidationError

View File

@@ -1,6 +1,7 @@
"""
Unit tests for the User model
"""
from unittest import mock
from django.core.exceptions import ValidationError

View File

@@ -1,6 +1,7 @@
"""
Test Throttle in People's app.
"""
import pytest
from rest_framework.test import APIClient

View File

@@ -2,6 +2,7 @@
Management command overriding the "createsuperuser" command to allow creating users
with their email and no username.
"""
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand

View File

@@ -1,4 +1,5 @@
"""Test the `create_demo` management command"""
from unittest import mock
from django.core.management import call_command

View File

@@ -2,6 +2,7 @@
"""
People's sandbox management script.
"""
import os
import sys

View File

@@ -1,4 +1,5 @@
"""API URL Configuration"""
from django.conf import settings
from django.urls import include, path, re_path

View File

@@ -1,4 +1,5 @@
"""People celery configuration file."""
import os
from celery import Celery

View File

@@ -9,6 +9,7 @@ https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import json
import os