Skip to content

Whitespace cleanup - #2018

Merged
mscuthbert merged 9 commits into
masterfrom
e12-and-docstring-blanks
Aug 28, 2026
Merged

Whitespace cleanup#2018
mscuthbert merged 9 commits into
masterfrom
e12-and-docstring-blanks

Conversation

@mscuthbert

Copy link
Copy Markdown
Member

Whitespace CLEANUP!
Get your useless WHITESPACE CLEANUP here!

314 docstrings ended with a blank line before their closing quotes, a few began
with one after the opening quotes.  Whitespace only: a doctest's expected output
is already terminated by the end of the docstring, so the blank line was doing
nothing.

Covers docstrings proper plus the doc strings held in _DOC_ATTR dicts.

AI-assisted (Claude)
383 E127/E128 continuation lines across 58 modules sat at an indent that had
drifted from the bracket they belong to -- most of them badly over-indented,
like serial.historicalDict's rows and scale's IntervalNetwork edge dicts, where
the second line of each entry started fifteen columns right of the first.
autopep8 --select=E12 did the reindent; `pycodestyle --select=E12 music21` is
now silent.

Four lines had to be rewrapped by hand: three that the new indent pushed past
100 characters (analysis/reduction, roman, stream/makeNotation) and one string
in musicxml/test_xmlToM21 that had been hiding under an indent of 8.

Also annotates the three graph.axis __init__s that returned mypy's
annotation-unchecked note, which their bodies' inline annotations had earned.
repeat.simplify and stream.filters.OffsetFilter.__init__ still raise it; both
need a real signature rather than a bare `-> None` (simplify returns a Stream
unless inPlace), so they are left alone.

AI-assisted (Claude)
Aligned to the opening bracket, the tuple of articulation strings started at
column 46 and every row after the first was mostly leading whitespace.  Break
after the paren instead and indent the strings one step, closing on its own line.

Also restores repeat.py's continuation fix, lost when the file was reverted.

AI-assisted (Claude)
Every entry after `(None,)` sat at column 21, aligned to nothing -- the dict
opens with a hanging indent, so pycodestyle's E12 checks accept whatever the
rows do as long as the first one is indented.

AI-assisted (Claude)
Aligning to the opening bracket pushed the expected legend out to column 25 and
its rows past that.  Break after `assertEqual(` so both arguments sit one step
in, which is where the list was before.

AI-assisted (Claude)
'sound' in partStaffExporter's tagList sat eight columns right of the other four
tags.  Five multi-line `if` conditions had the same drift in a different form:
the first `and` at the opening paren's column, the next one four further in, so
neither row lined up with anything.  Put every row of each on one column -- the
+8 the rest of the codebase uses for a wrapped condition.

pycodestyle's E12 checks pass either way; they accept several alternative
indents once brackets nest, and only look at a row in isolation.

AI-assisted (Claude)
Aligned to the opening paren, the method chain started at column 25 and its
arguments ran out past 29.  Break after the paren so the whole chain sits one
step in, which is the spacing it had.

AI-assisted (Claude)
Aligning to the opening bracket only pays when there is room to the right of it.
scala's two cents assertions were aligned at column 73, leaving eight characters
of usable width; variant's getElementsByOffset calls at 49-61.  Break after the
paren in those, so the arguments start one step in.

Covers every call in the branch whose visual indent passed 40, plus the two
stream/tests assertions and testMakeRestsB.  variant's eight getElementsByOffset
calls now share one shape, one argument per row.

AI-assisted (Claude)
Both runners were listed as equals, with testSingleCoreAll marked "use before
pushing to a PR" -- so it got run routinely, at 45 seconds against
multiprocessTest's 10.  That is a long time to leave someone waiting for an
answer the parallel runner gives just as well.

Says which one to use and confines the single-core runner to what it alone can
tell you: a release check, a CI failure that will not reproduce, one core.

AI-assisted (Claude)
@coveralls

coveralls commented Aug 28, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 93.336%. remained the same — e12-and-docstring-blanks into master

@mscuthbert
mscuthbert merged commit 3609627 into master Aug 28, 2026
7 checks passed
@mscuthbert
mscuthbert deleted the e12-and-docstring-blanks branch August 28, 2026 23:51
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