Skip to content

fix: resolve ruff lint errors in Python scripts#20

Merged
CybotTM merged 2 commits intomainfrom
fix/python-lint
Mar 29, 2026
Merged

fix: resolve ruff lint errors in Python scripts#20
CybotTM merged 2 commits intomainfrom
fix/python-lint

Conversation

@CybotTM
Copy link
Copy Markdown
Member

@CybotTM CybotTM commented Mar 29, 2026

Summary

  • Remove unused pathlib.Path import from matrix-doctor.py (F401)
  • Add ruff.toml to suppress E402 for e2ee scripts where from nio import must follow the check_e2ee_dependencies() guard call

Test plan

  • CI lint passes (ruff check returns 0 errors)

CybotTM added 2 commits March 29, 2026 10:22
Remove unused pathlib.Path import from matrix-doctor.py and add
ruff.toml to suppress E402 for e2ee scripts where nio imports
must follow the check_e2ee_dependencies() guard.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a Ruff configuration to ignore E402 linting errors for specific Matrix E2EE scripts and removes an unused import in matrix-doctor.py. Feedback was provided to refine the glob pattern in ruff.toml for better precision and to avoid matching unintended files.

@@ -0,0 +1,3 @@
[lint.per-file-ignores]
# E402: nio imports must come after check_e2ee_dependencies() call
"skills/matrix-communication/scripts/matrix-*e2ee*.py" = ["E402"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The glob pattern matrix-*e2ee*.py is a bit broad and could match unintended files in the future (e.g., a new file named matrix-e2ee.py). For better precision and maintainability, consider using two more specific globs to cover the existing file patterns.

Suggested change
"skills/matrix-communication/scripts/matrix-*e2ee*.py" = ["E402"]
"skills/matrix-communication/scripts/matrix-e2ee-*.py" = ["E402"]
"skills/matrix-communication/scripts/matrix-*-e2ee.py" = ["E402"]

@CybotTM CybotTM merged commit 8c827b5 into main Mar 29, 2026
6 checks passed
@CybotTM CybotTM deleted the fix/python-lint branch March 29, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant