Skip to content

Remove separator banners in toolchain Python (the rule the linter enforces on src/) #1486

Description

@sbryngelson

The source linter forbids ===/---- separators in src/ and Python comments, but the toolchain's own Python uses runtime-generated and Unicode separators that the linter cannot see.

Confirmed locations:

  • toolchain/mfc/gen_case_constraints_docs.py:78print("=" * 70, file=sys.stderr)
  • toolchain/mfc/gen_case_constraints_docs.py:85print("=" * 70, file=sys.stderr)
  • toolchain/mfc/viz/interactive.py9 box-drawing banner comments using ── (lines 1122, 1133, 1175, 1187, 1208, 1261, 1279, 1321, 1418), e.g.:
            # ── Variable ──────────────────────────────────────────────────

Why the linter misses them: check_junk_comments matches ===|-{4,} against #-comment lines.

  • print("=" * 70) is a string-multiply expression; the source text contains a single = inside a string literal, so the === pattern never matches — the banner only exists at runtime.
  • The # ── Variable ── comments use U+2500 box-drawing chars, not ASCII -, so -{4,} never matches.

Also found by grep (same class, broader scope): "=" * N print banners in toolchain/mfc/params_tests/{coverage,inventory,snapshot,runner}.py and "-" * len(...) in toolchain/main.py. Mentioned so a fixer can decide whether to sweep all of them.

Fix: remove the banner print("=" * 70) calls (keep the message lines) and delete the # ── ... ── decorator comments. Output-neutral (toolchain stdout/docs cosmetics only).

Optional follow-on: extend check_junk_comments to also flag "=" * <int> / "-" * <int> with large N and U+2500 runs, so this rule self-enforces in the toolchain too.


Filed from a repo-wide code-cleanliness review; verified against master @ 40dde5e.

Code references

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions