Unused import A module is imported (using the import statement) but t… #54

Merged
jmiller-moko merged 3 commits from dev/security-update-2025-01-17 into main 2026-01-17 23:32:49 +00:00
jmiller-moko commented 2026-01-17 23:29:12 +00:00 (Migrated from github.com)

…hat module is never used. This creates a dependency that does not need to exist and makes the code more difficult to read. Recommendation Delete the import statement.

Pull Request

Purpose

Change Summary

Testing Evidence

Risk and Rollback

Checklist

  • Follows Conventional Commits
  • Tests added or updated
  • Documentation updated if required
  • License header present where applicable
  • Linked issue(s) referenced

Reviewer Notes

Review and Approval

…hat module is never used. This creates a dependency that does not need to exist and makes the code more difficult to read. Recommendation Delete the import statement. # Pull Request ## Purpose ## Change Summary ## Testing Evidence ## Risk and Rollback ## Checklist - [ ] Follows Conventional Commits - [ ] Tests added or updated - [ ] Documentation updated if required - [ ] License header present where applicable - [ ] Linked issue(s) referenced ## Reviewer Notes ## Review and Approval
github-actions[bot] commented 2026-01-17 23:29:25 +00:00 (Migrated from github.com)

Dependency Review

No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None
<h1>Dependency Review</h1> ✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.<h2>Scanned Files</h2> None <!-- dependency-review-pr-comment-marker -->
github-code-quality[bot] (Migrated from github.com) reviewed 2026-01-17 23:30:26 +00:00
github-code-quality[bot] (Migrated from github.com) commented 2026-01-17 23:30:26 +00:00

Unused local variable

Variable timestamp is not used.


In general, to fix an unused local variable warning, either remove the variable assignment if it is truly unnecessary, or update the code to use the value if it was intended to be used. This avoids dead code and makes the intent clearer.

Here, the single best fix without changing existing functionality is to remove the timestamp assignment on line 169, because the timestamp is not used to build zip_filename or for any logging. The behavior of the script—producing a deterministically named ZIP file based on repository name, version, and platform—remains unchanged. No other code changes are needed: no extra imports, methods, or definitions, and no modifications to the zip_filename logic, since it currently does not rely on the timestamp.

Concretely, in scripts/release/package_extension.py, inside the create_package function, delete the line that assigns timestamp and leave the subsequent platform_suffix, zip_filename, and zip_path lines intact.

## Unused local variable Variable timestamp is not used. --- In general, to fix an unused local variable warning, either remove the variable assignment if it is truly unnecessary, or update the code to use the value if it was intended to be used. This avoids dead code and makes the intent clearer.</p> <p>Here, the single best fix without changing existing functionality is to remove the <code>timestamp</code> assignment on line 169, because the timestamp is not used to build <code>zip_filename</code> or for any logging. The behavior of the script—producing a deterministically named ZIP file based on repository name, version, and platform—remains unchanged. No other code changes are needed: no extra imports, methods, or definitions, and no modifications to the <code>zip_filename</code> logic, since it currently does not rely on the timestamp.</p> <p>Concretely, in <code>scripts/release/package_extension.py</code>, inside the <code>create_package</code> function, delete the line that assigns <code>timestamp</code> and leave the subsequent <code>platform_suffix</code>, <code>zip_filename</code>, and <code>zip_path</code> lines intact.
github-code-quality[bot] (Migrated from github.com) commented 2026-01-17 23:30:26 +00:00

Unused local variable

Variable zip_path is not used.


In general, to fix an unused local variable, either use the variable meaningfully (e.g., log or return it) or remove the variable binding if the value is not needed. Here, main() is clearly designed to return only a status code, and the packaging path is not otherwise exposed, so the least intrusive change is to eliminate the unused variable and keep the call to create_package for its side effects.

Concretely, in scripts/release/package_extension.py around line 300, replace the assignment zip_path = create_package(...) with a direct call to create_package(...) without capturing the result. No other code depends on zip_path, so no additional changes, imports, or definitions are required.

## Unused local variable Variable zip_path is not used. --- In general, to fix an unused local variable, either use the variable meaningfully (e.g., log or return it) or remove the variable binding if the value is not needed. Here, <code>main()</code> is clearly designed to return only a status code, and the packaging path is not otherwise exposed, so the least intrusive change is to eliminate the unused variable and keep the call to <code>create_package</code> for its side effects.</p> <p>Concretely, in <code>scripts/release/package_extension.py</code> around line 300, replace the assignment <code>zip_path = create_package(...)</code> with a direct call to <code>create_package(...)</code> without capturing the result. No other code depends on <code>zip_path</code>, so no additional changes, imports, or definitions are required.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026-01-17 23:32:18 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull request overview

This pull request attempts to remove unused imports from four Python script files. However, the PR also introduces a pervasive indentation change from spaces to tabs across all modified files, which is a significant and problematic deviation from Python's PEP 8 style guide.

Changes:

  • Removes unused type imports (List, Tuple) from typing module where not needed
  • Removes unused module imports (joomla_manifest, os, shutil) that are not referenced in the code
  • Changes entire file indentation from spaces to tabs across all four files (unintended side effect)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
scripts/validate/workflows.py Removed unused List and Tuple imports, but entire file indentation changed to tabs (conflicts with its own check_no_tabs function)
scripts/run/validate_all.py Removed unused List import (kept Tuple), but entire file indentation changed to tabs
scripts/run/scaffold_extension.py Removed unused joomla_manifest import, but entire file indentation changed to tabs
scripts/release/package_extension.py Removed unused os, shutil, and List imports, but entire file indentation changed to tabs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull request overview This pull request attempts to remove unused imports from four Python script files. However, the PR also introduces a pervasive indentation change from spaces to tabs across all modified files, which is a significant and problematic deviation from Python's PEP 8 style guide. **Changes:** - Removes unused type imports (`List`, `Tuple`) from typing module where not needed - Removes unused module imports (`joomla_manifest`, `os`, `shutil`) that are not referenced in the code - Changes entire file indentation from spaces to tabs across all four files (unintended side effect) ### Reviewed changes Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments. | File | Description | | ---- | ----------- | | scripts/validate/workflows.py | Removed unused `List` and `Tuple` imports, but entire file indentation changed to tabs (conflicts with its own `check_no_tabs` function) | | scripts/run/validate_all.py | Removed unused `List` import (kept `Tuple`), but entire file indentation changed to tabs | | scripts/run/scaffold_extension.py | Removed unused `joomla_manifest` import, but entire file indentation changed to tabs | | scripts/release/package_extension.py | Removed unused `os`, `shutil`, and `List` imports, but entire file indentation changed to tabs | --- 💡 <a href="/mokoconsulting-tech/moko-cassiopeia/new/main/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-01-17 23:32:18 +00:00

Variable timestamp is not used.


Variable timestamp is not used. ```suggestion ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-01-17 23:32:18 +00:00

Variable zip_path is not used.

		create_package(
Variable zip_path is not used. ```suggestion create_package( ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-01-17 23:32:18 +00:00

The entire file's indentation has been changed from spaces to tabs. This conflicts with Python's PEP 8 style guide, which recommends using spaces over tabs for indentation. This change affects code maintainability and consistency across the project. The indentation should be reverted to use spaces consistently.

The entire file's indentation has been changed from spaces to tabs. This conflicts with Python's PEP 8 style guide, which recommends using spaces over tabs for indentation. This change affects code maintainability and consistency across the project. The indentation should be reverted to use spaces consistently.
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-01-17 23:32:17 +00:00

The entire file's indentation has been changed from spaces to tabs. This is a significant style change that conflicts with Python's PEP 8 style guide, which recommends spaces over tabs. Additionally, this file contains a function called check_no_tabs (line 76) that validates workflow files for the presence of tab characters, which creates an ironic inconsistency where the validation script itself uses tabs while checking for tabs in other files. This indentation change should be reverted to use spaces consistently with Python best practices.

The entire file's indentation has been changed from spaces to tabs. This is a significant style change that conflicts with Python's PEP 8 style guide, which recommends spaces over tabs. Additionally, this file contains a function called `check_no_tabs` (line 76) that validates workflow files for the presence of tab characters, which creates an ironic inconsistency where the validation script itself uses tabs while checking for tabs in other files. This indentation change should be reverted to use spaces consistently with Python best practices.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoCassiopeia#54