Skip to content

Conversation

@chennes
Copy link
Owner

@chennes chennes commented Dec 17, 2025

Merge for testing

@github-actions github-actions bot added the :octocat: label Dec 17, 2025
@chennes chennes force-pushed the addedDependencyChecker branch 6 times, most recently from 9b87133 to 284589b Compare December 18, 2025 01:38
@chennes chennes force-pushed the addedDependencyChecker branch from 284589b to 1c1e343 Compare December 19, 2025 21:27
"""Script to parse changed files and determine if any new C++ dependencies were added between
FreeCAD modules."""

import argparse

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'argparse' is not used.

Copilot Autofix

AI 15 days ago

To fix an unused-import issue, the general solution is to remove the import statement for any module that is not referenced anywhere in the file. This reduces clutter and avoids implying dependencies that are not actually required.

In this file, the argparse module imported on line 7 is not used in the provided code, while command-line handling is done via sys.argv. The safest, non‑functional change is to delete only the import argparse line and leave the rest of the imports untouched. No additional methods or definitions are required.

Concretely, in tools/lint/added_dependency.py, remove line 7 (import argparse) and do not replace it with anything. All remaining imports (os, re, sys, and the utils imports) stay as they are.

Suggested changeset 1
tools/lint/added_dependency.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/lint/added_dependency.py b/tools/lint/added_dependency.py
--- a/tools/lint/added_dependency.py
+++ b/tools/lint/added_dependency.py
@@ -4,7 +4,6 @@
 """Script to parse changed files and determine if any new C++ dependencies were added between
 FreeCAD modules."""
 
-import argparse
 import os
 import re
 import sys
EOF
@@ -4,7 +4,6 @@
"""Script to parse changed files and determine if any new C++ dependencies were added between
FreeCAD modules."""

import argparse
import os
import re
import sys
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +12 to +18
from utils import (
init_environment,
write_file,
append_file,
emit_problem_matchers,
add_common_arguments,
)

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'init_environment' is not used.
Import of 'write_file' is not used.
Import of 'append_file' is not used.
Import of 'emit_problem_matchers' is not used.
Import of 'add_common_arguments' is not used.

Copilot Autofix

AI 15 days ago

To fix unused-import issues, remove the unused names from the import statement (or remove the entire import if none of its names are needed). This eliminates the unnecessary dependency and clarifies which modules the file actually relies on.

In this file, the only use of utils is the from utils import (...) block on lines 12–18. Since CodeQL reports every imported symbol as unused and no usage is visible in the snippet, the best, non‑behavior‑changing fix is to delete this entire from utils import (...) block. No other code changes are needed, and no new imports or helper methods are required.

Concretely: in tools/lint/added_dependency.py, delete lines 12–18 containing the multi-line import from utils, leaving the rest of the file unchanged.

Suggested changeset 1
tools/lint/added_dependency.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/lint/added_dependency.py b/tools/lint/added_dependency.py
--- a/tools/lint/added_dependency.py
+++ b/tools/lint/added_dependency.py
@@ -9,14 +9,6 @@
 import re
 import sys
 
-from utils import (
-    init_environment,
-    write_file,
-    append_file,
-    emit_problem_matchers,
-    add_common_arguments,
-)
-
 KNOWN_MODULES = [
     "app",
     "base",
EOF
@@ -9,14 +9,6 @@
import re
import sys

from utils import (
init_environment,
write_file,
append_file,
emit_problem_matchers,
add_common_arguments,
)

KNOWN_MODULES = [
"app",
"base",
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants