Skip to content

Fix starboard embed SyntaxError and tighten flake8 linting#23

Merged
youngcoder45 merged 2 commits intomainfrom
yc45
Mar 29, 2026
Merged

Fix starboard embed SyntaxError and tighten flake8 linting#23
youngcoder45 merged 2 commits intomainfrom
yc45

Conversation

@youngcoder45
Copy link
Copy Markdown
Contributor

This PR fixes a flake8-blocking SyntaxError in the Starboard embed formatter and adds a repository-level flake8 configuration so linting focuses on project code (and doesn’t scan the local virtualenv).

What Changed

  • Starboard embed quoting
    • Fixes E999 SyntaxError: f-string expression part cannot include a backslash by moving the newline replacement out of the f-string expression.
    • Keeps the exact same rendered output for multi-line messages (still formats as a block quote).
  • Coding questions utility
    • Fixes F824 by removing an incorrect global _question_pool declaration (the pool is mutated but never reassigned).
  • Lint hygiene / cleanup
    • Adds .flake8 to exclude .venv, __pycache__, and build artifacts.
    • Removes a handful of unnecessary f-strings (F541) and unused locals (F841) without changing behavior (e.g., unused timers, unused exception variables).

Why

  • flake8 was failing on:
    • a starboard f-string that performed content.replace('\n', ...) directly inside the f-string expression, and
    • an invalid global declaration in utils/codingquestions.py.
  • flake8 runs were also noisy because they could traverse .venv and report third-party lint issues.

Testing

  • python -m flake8 . --select=E999,F824,F541,F841 (passes)
  • python -m flake8 . will still report existing style warnings (mostly E501/whitespace) in cogs/starboard.py that are out of scope for this PR.

Notes for Reviewers

  • Changes are intended to be behavior-preserving aside from fixing the Starboard embed formatting crash.
  • .flake8 only changes what gets linted; it doesn’t change runtime behavior.

@youngcoder45 youngcoder45 requested review from a team as code owners March 27, 2026 11:55
Copy link
Copy Markdown

@sinisterMage sinisterMage left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@youngcoder45 youngcoder45 added Fixed An Issue Fixed an Issue in this PR labels Mar 27, 2026
@youngcoder45 youngcoder45 merged commit d516f14 into main Mar 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fixed An Issue Fixed an Issue in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants