Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yanksyoon committed Jan 2, 2025
1 parent 5d5b8ba commit 26ed00a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions rockcraft/extensions/expressjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""An extension for the NodeJS based Javascript application extension."""
import json
import re
from typing import Any, Dict, Tuple
from typing import Any

from overrides import override

Expand All @@ -43,7 +43,7 @@ class ExpressJSFramework(Extension):

@staticmethod
@override
def get_supported_bases() -> Tuple[str, ...]:
def get_supported_bases() -> tuple[str, ...]:
"""Return supported bases."""
return "bare", "[email protected]", "[email protected]"

Expand All @@ -54,7 +54,7 @@ def is_experimental(base: str | None) -> bool:
return True

@override
def get_root_snippet(self) -> Dict[str, Any]:
def get_root_snippet(self) -> dict[str, Any]:
"""Fill in some default root components.
Default values:
Expand All @@ -66,7 +66,7 @@ def get_root_snippet(self) -> Dict[str, Any]:
"""
self._check_project()

snippet: Dict[str, Any] = {
snippet: dict[str, Any] = {
"run-user": "_daemon_",
"services": {
"app": {
Expand Down Expand Up @@ -120,7 +120,7 @@ def _gen_runtime_dependencies_part(self) -> dict:
}

@property
def _app_package_json(self):
def _app_package_json(self) -> dict:
"""Return the app package.json contents."""
package_json_file = self.project_root / "package.json"
if not package_json_file.exists():
Expand All @@ -138,7 +138,7 @@ def _app_name(self) -> str:
return self._app_package_json["name"]

@property
def _app_organise(self):
def _app_organise(self) -> dict:
"""Return the organised mapping for the ExpressJS project.
Use the paths generated by the
Expand All @@ -150,7 +150,6 @@ def _app_organise(self):
.get("expressjs-framework/install-app", {})
.get("prime", [])
)
print(user_prime)
if not all(re.match(f"-? *{self.IMAGE_BASE_DIR}/", p) for p in user_prime):
raise ExtensionError(
"expressjs-framework extension requires the 'prime' entry in the "
Expand All @@ -170,7 +169,7 @@ def _app_organise(self):
if (self.project_root / "app" / f).exists()
}

def _check_project(self):
def _check_project(self) -> None:
"""Ensure this extension can apply to the current rockcraft project.
The ExpressJS framework assumes that:
Expand Down

0 comments on commit 26ed00a

Please sign in to comment.