chore: apply ruff and formatting changes for better code quality
This commit is contained in:
3 files changed
+6
-7
No files matched your search
@@ -22,7 +22,6 @@ ignore = [
|
||||
"__init__.py" = ["F401"] # imported but unused
|
||||
|
||||
[format]
|
||||
docstring-code-format = true
|
||||
indent-style = "space"
|
||||
skip-magic-trailing-comma = false
|
||||
line-ending = "auto"
|
||||
|
||||
@@ -54,7 +54,7 @@ class AppManager:
|
||||
def _create_django_app(self) -> bool:
|
||||
# Detect project structure
|
||||
is_nested, nested_dir, apps_base_dir = self._detect_project_structure()
|
||||
|
||||
|
||||
# manage.py is always in the project root (current_dir), not in the project directory
|
||||
manage_py_path = os.path.join(self.current_dir, "manage.py")
|
||||
if not os.path.exists(manage_py_path):
|
||||
@@ -66,9 +66,9 @@ class AppManager:
|
||||
UIFormatter.print_info(f"Creating app '{self.app_name}' in directory: {os.getcwd()}")
|
||||
|
||||
result = subprocess.run(
|
||||
["django-admin", "startapp", self.app_name],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
["django-admin", "startapp", self.app_name],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True
|
||||
)
|
||||
|
||||
@@ -93,7 +93,7 @@ class AppManager:
|
||||
|
||||
# Detect project structure to determine the correct app module path
|
||||
is_nested, nested_dir, apps_base_dir = self._detect_project_structure()
|
||||
|
||||
|
||||
# Determine the correct module path for the app
|
||||
if is_nested and nested_dir:
|
||||
app_module_path = f"{nested_dir}.{self.app_name}"
|
||||
|
||||
@@ -298,7 +298,7 @@ def get_user_input() -> Tuple[str, str, str, list, dict]:
|
||||
project_dir = collector.get_validated_input(
|
||||
"Enter project directory name", validate_project_name, "project directory name"
|
||||
)
|
||||
|
||||
|
||||
# Check if directory exists and ask for alternative
|
||||
while os.path.exists(project_dir):
|
||||
UIFormatter.print_error(f"Directory '{project_dir}' already exists.")
|
||||
|
||||
Reference in new issue
Block a user