Background & Motivation
Currently, our Python formatting configuration in pyproject.toml ignores the E501 (line-too-long) Ruff lint rule. The codebase contains a multitude of violations where lines exceed the configured 80-character limit, making it exceptionally hard to fix them all at once. However, to adhere to our style guidelines and improve code readability, we need to enforce this rule and resolve the existing violations. Relying on # noqa comments to bypass the rule is discouraged, as it circumvents the underlying issue of excessively long lines.
Proposed Changes
- Configuration Update: Remove
"E501" from the ignore list under [tool.ruff.lint] in pyproject.toml.
- Fix Existing Violations: Go through the Python codebase (Backend/NDB models, Flask handlers, etc.) and refactor lines that exceed 80 characters. This will involve:
- Breaking down long strings, comments, and docstrings across multiple lines.
- Refactoring complex statements, function signatures, or data structures (like long lists/dictionaries) to span multiple lines for better formatting.
- Strict Enforcement: Avoid using
# noqa: E501 or similar comments to mask the issue. The lines themselves must be shortened to comply with the 80-character limit.
- Scope: This change targets the Backend (Python) codebase where Ruff is applied. The Frontend (Lit/JS) and API specifications are not impacted by this specific lint rule.
Acceptance Criteria
This issue description was drafted by Gemini
Background & Motivation
Currently, our Python formatting configuration in
pyproject.tomlignores theE501(line-too-long) Ruff lint rule. The codebase contains a multitude of violations where lines exceed the configured 80-character limit, making it exceptionally hard to fix them all at once. However, to adhere to our style guidelines and improve code readability, we need to enforce this rule and resolve the existing violations. Relying on# noqacomments to bypass the rule is discouraged, as it circumvents the underlying issue of excessively long lines.Proposed Changes
"E501"from theignorelist under[tool.ruff.lint]inpyproject.toml.# noqa: E501or similar comments to mask the issue. The lines themselves must be shortened to comply with the 80-character limit.Acceptance Criteria
"E501"is removed from theignorelist inpyproject.toml.E501errors across the Python codebase.# noqasuppressions are used to bypass the rule).This issue description was drafted by Gemini