Skip to content

refactor: cleanup ruff ignores and fix N818. Closes #640#692

Merged
mlodic merged 2 commits intointelowlproject:developfrom
opbot-xd:fix-n818-and-cleanup
Jan 9, 2026
Merged

refactor: cleanup ruff ignores and fix N818. Closes #640#692
mlodic merged 2 commits intointelowlproject:developfrom
opbot-xd:fix-n818-and-cleanup

Conversation

@opbot-xd
Copy link
Copy Markdown
Contributor

@opbot-xd opbot-xd commented Jan 9, 2026

Description

This PR finalizes the Ruff migration by addressing the remaining "safe to fix" rules that were previously ignored.

  • N818 (Exception Naming): Renamed ElasticServerDownException to ElasticServerDownError in greedybear/cronjobs/repositories/elastic.py and updated usages. This exception is internal, so renaming is safe.
  • Ruff Config Cleanup: Removed N804, N818, UP008, and UP031 from the ignore list in .ruff.toml as the codebase is now fully compliant with these rules.

Related issues

Follow-up to #663 (Ruff migration)
#640

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Checklist

  • I have read and understood the rules about how to Contribute to this project.
  • The pull request is for the branch develop.
  • I have added documentation of the new features.
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • All the tests (old ones) gave 0 errors.
  • If changes were made to an existing model/serializer/view, the docs were updated and regenerated (check CONTRIBUTE.md).
  • If the GUI has been modified:
    • I have a provided a screenshot of the result in the PR.
    • I have created new frontend tests for the new component or updated existing ones.

- Rename ElasticServerDownException → ElasticServerDownError (N818)
- Remove N804, N818, UP008, UP031 from ignores as they are fixed
- Codebase is now compliant with these rules
- Rename ElasticServerDownException → ElasticServerDownError (N818)
- Replace dict() with {} (C408)
- Remove N804, N818, UP008, UP031, C401, C408 from ignores
- Codebase is now compliant with these rules
- Verified all checks pass with explicit config
@opbot-xd
Copy link
Copy Markdown
Contributor Author

opbot-xd commented Jan 9, 2026

I also noticed there were only 2 occurrences of C408 (Unnecessary dict() calls), so I went ahead and fixed them to {} and removed C401 / C408 from the ignore list as well.

@opbot-xd
Copy link
Copy Markdown
Contributor Author

opbot-xd commented Jan 9, 2026

Remaining Ignores (17 violations):
The only rules left in the ignore list are intentional:

  • F403 (14 violations): Wildcard imports in __init__.py files. Keeping these to preserve the current package structure and API exposure without risk of breaking imports.
  • E501 (3 violations): Long lines in docstrings (URLs/examples) that are better left unbreakable for readability.

The codebase is now fully aligned with the updated Ruff configuration!

@mlodic mlodic merged commit f355365 into intelowlproject:develop Jan 9, 2026
5 checks passed
@mlodic
Copy link
Copy Markdown
Member

mlodic commented Jan 9, 2026

thank you!

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.

2 participants