Skip to content

Commit

Permalink
Make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
henhuy committed Feb 20, 2024
1 parent 46223ad commit 9d20d72
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{html,css,scss,json,yml,xml}]
[*.{html,css,scss,json,toml,yml,xml}]
indent_style = space
indent_size = 2

Expand Down
25 changes: 0 additions & 25 deletions .idea/runConfigurations/pytest___.xml

This file was deleted.

8 changes: 3 additions & 5 deletions config/api_router.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
"""API router setup."""

from django.conf import settings
from rest_framework.routers import DefaultRouter, SimpleRouter

from slapp.users.api.views import UserViewSet

if settings.DEBUG:
router = DefaultRouter()
else:
router = SimpleRouter()

router = DefaultRouter() if settings.DEBUG else SimpleRouter()
router.register("users", UserViewSet)


Expand Down
1 change: 1 addition & 0 deletions config/celery_app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Celery app configuration."""
import os

from celery import Celery
Expand Down
8 changes: 3 additions & 5 deletions config/settings/test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
With these settings, tests run faster.
"""
"""With these settings, tests run faster."""

from .base import * # noqa
from .base import * # noqa: F403
from .base import env

# GENERAL
Expand All @@ -27,7 +25,7 @@

# DEBUGGING FOR TEMPLATES
# ------------------------------------------------------------------------------
TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa: F405
TEMPLATES[0]["OPTIONS"]["debug"] = True # noqa: F405

# MEDIA
# ------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions merge_production_dotenvs_in_dotenv.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Merge env vars from docker config into env file."""
import os
from collections.abc import Sequence
from pathlib import Path
Expand All @@ -15,6 +16,7 @@ def merge(
output_file: Path,
files_to_merge: Sequence[Path],
) -> None:
"""Merge env vars from multiple files into single file."""
merged_content = ""
for merge_file in files_to_merge:
merged_content += merge_file.read_text()
Expand Down
12 changes: 8 additions & 4 deletions slapp/explorer/apps.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
"""AppConfig for slapp explorer."""
import contextlib

from django.apps import AppConfig


class ExplorerConfig(AppConfig):
"""AppConfig for slapp explorer app."""

default_auto_field = "django.db.models.BigAutoField"
name = "slapp.explorer"
verbose_name = "Explorer"

def ready(self):
try:
def ready(self) -> None:
"""Try to import signals for explorer app."""
with contextlib.suppress(ImportError):
import slapp.explorer.signals # noqa: F401
except ImportError:
pass
1 change: 1 addition & 0 deletions slapp/explorer/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Models for the explorer app."""
from django.contrib.gis.db import models
from django.utils.translation import gettext_lazy as _

Expand Down
6 changes: 5 additions & 1 deletion slapp/utils/data_processing.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"""Module to load (geo-)data into digiplan models."""

from __future__ import annotations

import logging
import pathlib
from typing import TYPE_CHECKING

from django.db.models import Model
if TYPE_CHECKING:
from django.db.models import Model

from config.settings.base import GEODATA_DIR
from slapp.explorer import models
Expand Down
File renamed without changes.
9 changes: 8 additions & 1 deletion tests/test_merge_production_dotenvs_in_dotenv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from pathlib import Path
"""Test for merging production dotenvs into env file."""
from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
from pathlib import Path

import pytest

Expand All @@ -21,6 +27,7 @@ def test_merge(
input_contents: list[str],
expected_output: str,
):
"""Test merging production dotenvs into single file."""
output_file = tmp_path / ".env"

files_to_merge = []
Expand Down

0 comments on commit 9d20d72

Please sign in to comment.