Skip to content

Commit 4fd1de0

Browse files
committed
chore: nettoyage du code avec ruff et correction des tests unitaires
1 parent 27b90fe commit 4fd1de0

16 files changed

Lines changed: 20 additions & 56 deletions

Core/Compiler/engine_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def sys_deps_manager(self):
363363
command = [safe_program] + safe_args
364364

365365
if on_stdout:
366-
on_stdout(f"Etape 3/3 : Execution du processus de compilation...")
366+
on_stdout("Etape 3/3 : Execution du processus de compilation...")
367367
on_stdout(f" Commande : {' '.join(command)}")
368368
on_stdout("-" * 40)
369369

Core/process_killer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from dataclasses import dataclass, field
3333
from datetime import datetime
3434
from pathlib import Path
35-
from typing import Any, Dict, List, Optional, Set
35+
from typing import Any, Dict, List, Optional
3636

3737
try:
3838
import psutil

Ui/Cli/launchers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
import os
44
import sys
55
from pathlib import Path
6-
from typing import Optional
76

87
from .icons import set_app_icon, set_window_icon
9-
from .output import error, warn
8+
from .output import error
109
from .runtime import ROOT_DIR, handle_fatal
1110

1211

@@ -58,7 +57,7 @@ def launch_main_application(
5857
) -> int:
5958
try:
6059
from PySide6.QtCore import Qt, QTimer
61-
from PySide6.QtGui import QColor, QPixmap
60+
from PySide6.QtGui import QPixmap
6261
from PySide6.QtWidgets import QSplashScreen
6362

6463
from Ui.Gui.Gui import PyCompilerArkGui

Ui/Gui/Compilation/mainprocess.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,12 @@
2929
from __future__ import annotations
3030

3131
import os
32-
import re
33-
import shlex
34-
import subprocess
35-
import sys
3632
from enum import Enum
3733
from pathlib import Path
38-
from typing import Any, Dict, List, Optional, Tuple
34+
from typing import Any, Dict, List, Optional
3935

4036
from PySide6.QtCore import QObject, Signal
4137

42-
from Core.Compiler.engine_runner import EngineRunnerError, resolve_engine_command
43-
from Core.Compiler.utils import (
44-
CommandBuilder,
45-
build_command,
46-
check_module_available,
47-
detect_python_executable,
48-
escape_arguments,
49-
get_interpreter_version,
50-
sanitize_path,
51-
validate_command,
52-
)
5338

5439
# Importations ArkConfig pour la gestion des exclusions
5540
from Core.Configs import DEFAULT_EXCLUDE_PATTERNS, load_ark_config, should_exclude_file

Ui/Gui/Dialogs/BcaslDialog.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,20 @@
3232
from typing import Any, Optional
3333

3434
import yaml
35-
from PySide6.QtCore import QByteArray, QMimeData, QObject, Qt, QThread, Signal, Slot
36-
from PySide6.QtGui import QColor, QKeySequence, QPalette, QShortcut
35+
from PySide6.QtCore import QObject, Qt, QThread, Signal, Slot
36+
from PySide6.QtGui import QKeySequence, QPalette, QShortcut
3737
from PySide6.QtWidgets import (
38-
QAbstractItemView,
3938
QApplication,
4039
QCheckBox,
4140
QDialog,
4241
QFrame,
4342
QGroupBox,
4443
QHBoxLayout,
4544
QLabel,
46-
QListWidget,
47-
QListWidgetItem,
4845
QMessageBox,
4946
QPushButton,
5047
QScrollArea,
5148
QSizePolicy,
52-
QSpinBox,
5349
QTabWidget,
5450
QVBoxLayout,
5551
QWidget,
@@ -467,7 +463,7 @@ def _build_ui(self) -> None:
467463

468464
# Titre
469465
title_row = QHBoxLayout()
470-
lbl = QLabel(f"<b>BCASL Pipeline</b>")
466+
lbl = QLabel("<b>BCASL Pipeline</b>")
471467
lbl.setTextFormat(Qt.RichText)
472468
title_row.addWidget(lbl)
473469
title_row.addStretch(1)
@@ -1169,8 +1165,6 @@ def run_pre_compile_async(
11691165
BCASL_DISABLED_REPORT,
11701166
_get_plugins_dir,
11711167
_is_bcasl_enabled,
1172-
_load_workspace_config,
1173-
_run_bcasl_sync,
11741168
)
11751169

11761170
# Étape 0: Vérifier si BCASL est activé globalement via ark.yml

Ui/Gui/Dialogs/CompilerDialog.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,16 @@
3131
import os
3232
import time
3333
from pathlib import Path
34-
from typing import Any, Optional
3534

36-
from PySide6.QtCore import QObject, QProcess, Signal
37-
from PySide6.QtWidgets import QApplication, QFileDialog, QMessageBox
35+
from PySide6.QtWidgets import QFileDialog, QMessageBox
3836

3937
from Core.Compiler import create
40-
from Ui.Gui.Compilation.compiler import CompilationStatus
4138
from Ui.Gui.Compilation.helpers import (
4239
bcasl_report_allows_compile,
4340
get_main_process,
44-
resolve_default_engine_id,
4541
run_bcasl_before_compile,
4642
)
47-
from Ui.Gui.Compilation.mainprocess import MainProcess, ProcessState
43+
from Ui.Gui.Compilation.mainprocess import ProcessState
4844
from Ui.i18n import log_i18n_level, log_with_level
4945

5046
# Shared helpers from CLI for exact code alignment

Ui/Gui/Dialogs/LockDialog.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import os
2323
from pathlib import Path
24-
from typing import Any
2524

2625
import yaml
2726
from PySide6.QtCore import Qt
@@ -37,7 +36,6 @@
3736
QPushButton,
3837
QSplitter,
3938
QVBoxLayout,
40-
QWidget,
4139
)
4240

4341
from Core.Locking import load_yaml_file

Ui/Gui/Dialogs/WorkspaceDialog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from __future__ import annotations
2424

2525
import os
26-
from pathlib import Path
2726
from typing import Optional
2827

2928
from PySide6.QtWidgets import QApplication, QFileDialog, QMessageBox

Ui/Gui/UiFeatures.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
Ce module ne contient que du code Qt. Toute logique métier est déléguée à Core/.
2020
"""
2121

22-
import asyncio
23-
import json
2422
import os
2523
import platform
2624
from typing import Callable

Ui/Gui/WorkspaceManipulation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from PySide6.QtGui import QDropEvent
2626
from PySide6.QtWidgets import QFileDialog, QMessageBox
2727

28-
from Core.Globals import _workspace_dir_lock
2928

3029

3130
class WorkspaceAdvancedManipulation:

0 commit comments

Comments
 (0)