Unused import A module is imported (using the import statement) but t… #54
Merged
jmiller-moko
merged 3 commits from 2026-01-17 23:32:49 +00:00
dev/security-update-2025-01-17 into main
Labels
Clear labels
automation
breaking-change
bug
build
ci-cd
config
css
dependencies
deploy-failure
docker
documentation
dolibarr
duplicate
enhancement
generic
good first issue
health-check
health: excellent
health: fair
health: good
health: poor
help wanted
html
invalid
javascript
joomla
major-release
minor-release
mokostandards
needs-changelog
needs-review
needs-testing
patch-release
php
priority: critical
priority: high
priority: low
priority: medium
push-failure
python
question
regression
release
release-candidate
security
size/l
size/m
size/s
size/xl
size/xs
size/xxl
standards-drift
standards-update
standards-violation
status: blocked
status: in-progress
status: on-hold
status: pending
status: wontfix
sync-failure
sync-report
template-validation-failure
test-failure
tests
type: bug
type: chore
type: enhancement
type: feature
type: refactor
type: release
type: test
type: version
typescript
version
version-branch
version-drift
version-update
wontfix
work-in-progress
bug
chore
documentation
enhancement
feature
priority: critical
priority: high
priority: low
priority: medium
refactor
scope: client
scope: dolibarr
scope: infrastructure
scope: joomla
scope: waas
security
status: blocked
status: duplicate
status: in-progress
status: needs-review
status: wontfix
Automated processes or scripts
Breaking API or functionality change
Something isn't working
Build system changes
CI/CD pipeline changes
Configuration file changes
CSS/styling changes
Dependency updates
Automated deploy failure tracking
Docker configuration changes
Documentation changes
Dolibarr module or extension
This issue or pull request already exists
New feature or request
Generic project or library
Good for newcomers
Repository health check results
Health score 90-100
Health score 50-69
Health score 70-89
Health score below 50
Extra attention is needed
HTML template changes
This doesn't seem right
JavaScript code changes
Joomla extension or component
Major version release (breaking changes)
Minor version release (XX.YY.00)
MokoStandards compliance
Awaiting code review
Requires manual or automated testing
Patch version release (XX.YY.ZZ)
PHP code changes
Critical priority, must be addressed immediately
High priority
Low priority
Medium priority
File push failure requiring attention
Python code changes
Further information is requested
Regression from a previous working state
Release related PR
Release candidate build
Security-related changes
Large change (101-300 lines)
Medium change (31-100 lines)
Small change (11-30 lines)
Extra large change (301-1000 lines)
Extra small change (1-10 lines)
Extremely large change (1000+ lines)
Repository drifted from MokoStandards
MokoStandards sync update
Standards compliance failure
Blocked by another issue or dependency
Currently being worked on
Temporarily on hold
Pending action or decision
This will not be worked on
Bulk sync failure requiring attention
Bulk sync run report
Template workflow validation failure
Automated test failure
Test suite changes
Something isn't working
Maintenance tasks
Enhancement to existing feature
New feature or request
Code refactoring
Release preparation or tracking
Test suite additions or changes
Version-related change
TypeScript code changes
Version bump or release
Version branch related
Version mismatch detected
Version bump and release PR
This will not be worked on
Work in progress, not ready for merge
Something is not working
Maintenance and housekeeping
Documentation improvements
Improvement to existing functionality
New feature or request
Must fix immediately
Should fix soon
Nice to have
Fix when convenient
Code restructuring without behavior change
Client-specific work
Dolibarr modules and customizations
Server, CI, backups, monitoring
Joomla templates and extensions
MokoWaaS platform
Security vulnerability or hardening
Waiting on external dependency
Duplicate of another issue
Being worked on
Ready for review
Will not be addressed
No Label
Milestone
No items
No Milestone
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: MokoConsulting/MokoCassiopeia#54
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "dev/security-update-2025-01-17"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
…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
Reviewer Notes
Review and Approval
Dependency Review
✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned Files
NoneUnused 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
timestampassignment on line 169, because the timestamp is not used to buildzip_filenameor 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 thezip_filenamelogic, since it currently does not rely on the timestamp.Concretely, in
scripts/release/package_extension.py, inside thecreate_packagefunction, delete the line that assignstimestampand leave the subsequentplatform_suffix,zip_filename, andzip_pathlines intact.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 tocreate_packagefor its side effects.Concretely, in
scripts/release/package_extension.pyaround line 300, replace the assignmentzip_path = create_package(...)with a direct call tocreate_package(...)without capturing the result. No other code depends onzip_path, so no additional changes, imports, or definitions are required.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:
List,Tuple) from typing module where not neededjoomla_manifest,os,shutil) that are not referenced in the codeReviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
ListandTupleimports, but entire file indentation changed to tabs (conflicts with its owncheck_no_tabsfunction)Listimport (keptTuple), but entire file indentation changed to tabsjoomla_manifestimport, but entire file indentation changed to tabsos,shutil, andListimports, but entire file indentation changed to tabs💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Variable timestamp is not used.
Variable zip_path is not used.
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 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.