Skip to content

Commit

Permalink
🚨(project) fix black linter warning
Browse files Browse the repository at this point in the history
In release 24.1.0, black enforces newline after module docstrings.
  • Loading branch information
quitterie-lcs committed Jan 31, 2024
1 parent 2b2ac3b commit 1fc1f86
Show file tree
Hide file tree
Showing 49 changed files with 46 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/api/core/warren/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warren API root."""

from contextlib import asynccontextmanager

import sentry_sdk
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/api/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warren API v1."""

import logging
import sys

Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warren CLI entrypoint."""

import asyncio
import json
import logging
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warren persistence database connection."""

import logging
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/indicators/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Abstract class defining the interface for an indicator."""

import copy
import inspect
from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/indicators/mixins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mixins for indicators."""

import hashlib
import inspect
import logging
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/indicators/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Indicators SQL Models."""

from datetime import datetime, timezone
from typing import Optional, Union
from uuid import UUID, uuid4
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/migrations/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alembic configuration."""

# ruff: noqa: I001
from logging.config import fileConfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-11-09 10:09:55.063434
"""

from typing import Sequence, Union

from alembic import op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-09-07 15:40:04.677683
"""

from typing import Sequence, Union

from alembic import op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-09-26 07:55:28.887657
"""

from typing import Sequence, Union

from alembic import op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-12-07 14:41:56.720633
"""

from typing import Sequence, Union

from alembic import op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-11-28 14:42:25.711744
"""

from typing import Sequence, Union

from alembic import op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-11-28 14:13:27.739680
"""

from typing import Sequence, Union

from alembic import op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-11-09 10:33:53.610165
"""

from typing import Sequence, Union

from alembic import op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-08-24 16:32:53.984506
"""

from typing import Sequence, Union

from alembic import op
Expand Down
2 changes: 2 additions & 0 deletions src/api/core/warren/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warren's core models."""

from datetime import datetime
from functools import reduce
from itertools import groupby
Expand Down Expand Up @@ -236,6 +237,7 @@ def to_daily_counts(self):
total = sum(c.count for c in counts)
return DailyCounts(total=total, counts=counts)


class LTIUser(BaseModel):
"""Model to represent LTI user data."""

Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/api/test_health.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the health check endpoints."""

import pytest
from ralph.backends.data.base import DataBackendStatus

Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/fixtures/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fixtures for the authorization headers of warren api."""

import datetime
import uuid

Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/fixtures/db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fixtures for Warren api database."""

import pytest
from alembic import command
from alembic.config import Config
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/indicators/test_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the functions from the BaseIndicator class."""

import pytest
from pytest_httpx import HTTPXMock
from ralph.backends.lrs.base import LRSStatementsQuery
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/indicators/test_mixins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test indicators mixins."""

import hashlib
from datetime import datetime, timezone
from functools import cached_property
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/indicators/test_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test indicators models."""

import json
from datetime import datetime, timezone
from uuid import UUID
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Warren commands functions."""

from unittest.mock import AsyncMock, MagicMock

import pytest
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/test_db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for Warren db module."""

from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import Session as SASession

Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the core models."""

import datetime
from random import randint

Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Warren utility functions."""

import datetime
import uuid
from logging import Logger
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/tests/test_xapi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test xAPI transformers."""

import pandas as pd

from warren.factories.base import BaseXapiStatementFactory
Expand Down
1 change: 0 additions & 1 deletion src/api/core/warren/tests/xi/indexers/test_factories.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests for indexers and source factories."""


import re
from typing import Optional

Expand Down
1 change: 0 additions & 1 deletion src/api/core/warren/tests/xi/indexers/test_mixins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests for indexers' Mixins."""


import pytest

from warren.xi.indexers.mixins import LangStringMixin
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warren utils."""

import logging
from functools import reduce
from typing import Callable
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/xapi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""xAPI data transformers."""

import hashlib
import logging
from typing import List, Optional
Expand Down
1 change: 0 additions & 1 deletion src/api/core/warren/xi/indexers/etl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Experience Index ETL Protocol and Mixin for indexers."""


from typing import Iterator, List, Protocol, TypeVar


Expand Down
1 change: 0 additions & 1 deletion src/api/core/warren/xi/indexers/mixins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Experience Index indexers Mixins."""


from typing import Optional, Union


Expand Down
6 changes: 3 additions & 3 deletions src/api/core/warren/xi/indexers/moodle/etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ async def _load(self, data: Iterator[ExperienceCreate]) -> None:
for experience in data:
try:
# If a new experience is created, it will return a UUID
response: Union[
UUID, Experience
] = await self._xi.experience.create_or_update(experience)
response: Union[UUID, Experience] = (
await self._xi.experience.create_or_update(experience)
)

# If it's a new experience, create relations to its course
if isinstance(response, UUID):
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/xi/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Experience Index Pydantic Models."""

from datetime import datetime
from typing import List, Optional
from uuid import UUID
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/xi/routers/experiences.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Experience Index API Experiences router."""

import logging
from typing import List, Optional
from uuid import UUID
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/xi/routers/relations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Experience Index API Relations router."""

import logging
from typing import List
from uuid import UUID
Expand Down
1 change: 1 addition & 0 deletions src/api/core/warren/xi/schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Experience Index SQL Models."""

from datetime import datetime, timezone
from typing import List, Optional, Tuple, Union
from uuid import UUID, uuid4
Expand Down
1 change: 1 addition & 0 deletions src/api/plugins/video/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the video API endpoints."""

import json
import re
import urllib
Expand Down
1 change: 1 addition & 0 deletions src/api/plugins/video/tests/test_indicators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for video indicators."""

import json
import re
import urllib
Expand Down
1 change: 1 addition & 0 deletions src/api/plugins/video/warren_video/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warren API v1 video router."""

import logging

from fastapi import APIRouter, Depends, HTTPException, status
Expand Down
1 change: 1 addition & 0 deletions src/api/plugins/video/warren_video/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Factories for video xAPI events."""

from ralph.models.xapi.concepts.constants.video import RESULT_EXTENSION_TIME
from ralph.models.xapi.lms.statements import LMSDownloadedVideo
from ralph.models.xapi.video.statements import VideoPlayed
Expand Down
1 change: 1 addition & 0 deletions src/app/apps/lti/tests/test_lti_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the LTI configuration view."""

import xmltodict
from django.test import TestCase, override_settings

Expand Down
1 change: 0 additions & 1 deletion src/app/apps/lti/tests/test_lti_request.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests for the LTI request view."""


import json
import re
from html import unescape
Expand Down
1 change: 0 additions & 1 deletion src/app/apps/lti/tests/test_lti_respond.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests for the LTI respond view."""


import json
from logging import Logger
from unittest import mock
Expand Down
1 change: 0 additions & 1 deletion src/app/apps/lti/tests/test_lti_select.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests for the LTI select view."""


import json
import re
from html import unescape
Expand Down
1 change: 0 additions & 1 deletion src/app/apps/lti/tests/test_token.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests for the Token classes."""


from urllib.parse import urlencode

from django.test import RequestFactory, TestCase
Expand Down
6 changes: 3 additions & 3 deletions src/app/apps/lti/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def get_context_data(self, **kwargs):
else ""
)
return {
"code": settings.LTI_CONFIG_TITLE.lower()
if settings.LTI_CONFIG_TITLE
else None,
"code": (
settings.LTI_CONFIG_TITLE.lower() if settings.LTI_CONFIG_TITLE else None
),
"contact_email": settings.LTI_CONFIG_CONTACT_EMAIL,
"description": settings.LTI_CONFIG_DESCRIPTION,
"host": host,
Expand Down

0 comments on commit 1fc1f86

Please sign in to comment.