Skip to content

Commit

Permalink
Apply pre-commit fix
Browse files Browse the repository at this point in the history
From the artifact of the previous workflow run
  • Loading branch information
geo-ghci-int[bot] committed Nov 14, 2024
1 parent affe1d7 commit c94b0f6
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 52 deletions.
3 changes: 1 addition & 2 deletions github_app_geo_project/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@


def apply_profile_inheritance(profile_name: str, profiles: dict[str, Any]) -> None:
"""Apply the inheritance of the profile.
"""
"""Apply the inheritance of the profile."""
for other_name, other_profile in APPLICATION_CONFIGURATION["profiles"].items():
if other_profile.get("inherits") == profile_name:
_LOGGER.debug("Apply inheritance %s -> %s", profile_name, other_name)
Expand Down
3 changes: 2 additions & 1 deletion github_app_geo_project/module/audit/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Automatically generated file from a JSON schema.
"""
Automatically generated file from a JSON schema.
"""

from typing import Any, Literal, TypedDict, Union
Expand Down
14 changes: 7 additions & 7 deletions github_app_geo_project/module/audit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,7 @@ async def _npm_audit_fix(
def outdated_versions(
security: security_md.Security,
) -> list[str | models.OutputData]:
"""Check that the versions from the SECURITY.md are not outdated.
"""
"""Check that the versions from the SECURITY.md are not outdated."""
version_index = security.headers.index("Version")
date_index = security.headers.index("Supported Until")

Expand All @@ -633,8 +632,7 @@ def outdated_versions(
def _get_sources(
dist: str, config: configuration.DpkgConfiguration, local_config: configuration.DpkgConfiguration
) -> apt_repo.APTSources:
"""Get the sources for the distribution.
"""
"""Get the sources for the distribution."""
if dist not in _SOURCES:
conf = local_config.get("sources", config.get("sources", configuration.DPKG_SOURCES_DEFAULT))
if dist not in conf:
Expand Down Expand Up @@ -675,9 +673,11 @@ async def _get_packages_version(
) -> str | None:
"""Get the version of the package."""
global _GENERATION_TIME # pylint: disable=global-statement
if _GENERATION_TIME is None or datetime.datetime.now() - utils.parse_duration(
os.environ.get("GHCI_DPKG_CACHE_DURATION", "3h")
) > _GENERATION_TIME:
if (
_GENERATION_TIME is None
or datetime.datetime.now() - utils.parse_duration(os.environ.get("GHCI_DPKG_CACHE_DURATION", "3h"))
> _GENERATION_TIME
):
_PACKAGE_VERSION.clear()
_SOURCES.clear()
_GENERATION_TIME = datetime.datetime.now()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Automatically generated file from a JSON schema.
"""
Automatically generated file from a JSON schema.
"""

from typing import TypedDict
Expand Down
3 changes: 1 addition & 2 deletions github_app_geo_project/module/pull_request/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def _get_code_spell_command(
],
ignore_file: NamedTemporaryFileStr,
) -> list[str]:
"""Get the codespell command.
"""
"""Get the codespell command."""
config = context.module_config
code_spell_config = config.get("codespell", {})
code_spell_config = code_spell_config if isinstance(code_spell_config, dict) else {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Automatically generated file from a JSON schema.
"""
Automatically generated file from a JSON schema.
"""

from typing import TypedDict, Union
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Automatically generated file from a JSON schema.
"""
Automatically generated file from a JSON schema.
"""

from typing import TypedDict
Expand Down
6 changes: 4 additions & 2 deletions github_app_geo_project/module/standard/auto_configuration.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"""Automatically generated file from a JSON schema.
"""
Automatically generated file from a JSON schema.
"""

from typing import TypedDict


class AutoPullRequest(TypedDict, total=False):
"""Auto pull request.
"""
Auto pull request.
auto pull request configuration
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Automatically generated file from a JSON schema.
"""
Automatically generated file from a JSON schema.
"""

from typing import Literal, TypedDict, Union
Expand Down Expand Up @@ -62,7 +63,8 @@ class ChangelogConfigurationBase(TypedDict, total=False):


class ChangelogLabelConfiguration(TypedDict, total=False):
"""Changelog label configuration.
"""
Changelog label configuration.
The label configuration
"""
Expand All @@ -83,7 +85,8 @@ class ChangelogLabelConfiguration(TypedDict, total=False):


class ChangelogRoutingConfiguration(TypedDict, total=False):
"""Changelog routing configuration.
"""
Changelog routing configuration.
The routing configuration
"""
Expand Down Expand Up @@ -195,7 +198,8 @@ class ConditionTitle(TypedDict, total=False):


class Section(TypedDict, total=False):
"""section.
"""
section.
The section configuration
"""
Expand Down
3 changes: 2 additions & 1 deletion github_app_geo_project/module/versions/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Automatically generated file from a JSON schema.
"""
Automatically generated file from a JSON schema.
"""

from typing import Any, TypedDict
Expand Down
3 changes: 1 addition & 2 deletions github_app_geo_project/scripts/health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@


def main() -> None:
"""Check the health of the process-queue daemon.
"""
"""Check the health of the process-queue daemon."""
parser = argparse.ArgumentParser(description="Check the health of the process-queue daemon")
parser.add_argument("--timeout", type=int, help="Timeout in seconds")
args = parser.parse_args()
Expand Down
8 changes: 1 addition & 7 deletions github_app_geo_project/scripts/process_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@
import sqlalchemy.orm
from prometheus_client import Gauge

from github_app_geo_project import (
configuration,
models,
module,
project_configuration,
utils,
)
from github_app_geo_project import configuration, models, module, project_configuration, utils
from github_app_geo_project.module import modules
from github_app_geo_project.module import utils as module_utils
from github_app_geo_project.views import webhook
Expand Down
15 changes: 5 additions & 10 deletions github_app_geo_project/templates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@


def sanitizer(text: str) -> str:
"""Sanitize the input string.
"""
"""Sanitize the input string."""
sanitizer_instance = html_sanitizer.Sanitizer(
{
"tags": html_sanitizer.sanitizer.DEFAULT_SETTINGS["tags"] | {"span", "div", "pre", "code"},
Expand Down Expand Up @@ -46,14 +45,12 @@ def sanitizer(text: str) -> str:


def markdown(text: str) -> str:
"""Convert the input string to markdown.
"""
"""Convert the input string to markdown."""
return sanitizer(markdown_lib.markdown(text))


def pprint_short_date(date_in: str | datetime) -> str:
"""Pretty print a short date (essentially time to current time).
"""
"""Pretty print a short date (essentially time to current time)."""
if date_in == "None" or date_in is None:
return "-"

Expand All @@ -77,8 +74,7 @@ def pprint_short_date(date_in: str | datetime) -> str:


def pprint_full_date(date_in: str | datetime) -> str:
"""Pretty print a full date.
"""
"""Pretty print a full date."""
if date_in == "None" or date_in is None:
return "-"

Expand All @@ -101,8 +97,7 @@ def pprint_date(date_in: str | datetime) -> str:


def pprint_duration(duration_in: str | timedelta) -> str:
"""Pretty print a duration.
"""
"""Pretty print a duration."""
if duration_in == "None" or duration_in is None:
return "-"

Expand Down
6 changes: 1 addition & 5 deletions github_app_geo_project/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@

from github_app_geo_project import configuration, models, project_configuration, utils
from github_app_geo_project.module import modules
from github_app_geo_project.templates import (
pprint_duration,
pprint_full_date,
pprint_short_date,
)
from github_app_geo_project.templates import pprint_duration, pprint_full_date, pprint_short_date

_LOGGER = logging.getLogger(__name__)

Expand Down
7 changes: 1 addition & 6 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@

import gunicorn.arbiter
import gunicorn.workers.base
from c2cwsgiutils import (
get_config_defaults,
get_logconfig_dict,
get_paste_config,
prometheus,
)
from c2cwsgiutils import get_config_defaults, get_logconfig_dict, get_paste_config, prometheus
from prometheus_client import multiprocess

bind = ":8080" # pylint: disable=invalid-name
Expand Down

0 comments on commit c94b0f6

Please sign in to comment.