From 5b2ed44a64376bbe018f1e9c11e1a9972bf7cc9a Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 29 Oct 2025 12:17:46 +0545 Subject: [PATCH] chore: apply ruff and formatting changes for better code quality --- ruff.toml | 1 - src/scripts/app_generator.py | 10 +++++----- src/scripts/input_handler.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ruff.toml b/ruff.toml index fd3181a..226cfb7 100644 --- a/ruff.toml +++ b/ruff.toml @@ -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" diff --git a/src/scripts/app_generator.py b/src/scripts/app_generator.py index ab20b30..c6e640e 100644 --- a/src/scripts/app_generator.py +++ b/src/scripts/app_generator.py @@ -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}" diff --git a/src/scripts/input_handler.py b/src/scripts/input_handler.py index 5250c6f..dae7ac4 100644 --- a/src/scripts/input_handler.py +++ b/src/scripts/input_handler.py @@ -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.")