Repository navigation
Align a table row that ends in a comment, and the rows after it - #38
Merged
Merged
Conversation
The engine's printer now writes a comment after a Markdown row back on that row (relix-core fix/table-row-comments). fmt's column alignment took a row to end in |, so a commented row ended the run being aligned and every row after it was left as the printer wrote it. A row's cells are now aligned without its comment, which follows them after two spaces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the two
FmtTestfailures onleague.relix(keeps every comment, in order and --keywords parses to the same statements), which fail ondevelopwith the current engine snapshot.Needs DarkCollective/relix-core#106 in the snapshot first. Until it is published, CI here fails on those two cases and on the new test.
Cause
league.relixhas comments at the end of two inline-table rows. The engine's printer moved them off their rows to after the table's](relix-core#106 fixes that). Once they stay on their rows,fmt's own column alignment was the next problem: it took a row to end in|, so a commented row ended the run being aligned, and every row after it was left unaligned:Change
ScriptFormatter.Tablesaligns a row's cells without its--comment, then writes the comment after them, two spaces from the last|. A comment is found as the parser finds it: after the row's last|.Tests
FmtTest.Layout.rowCommentchecks that commented rows, and the rows after them, are aligned with each comment kept on its row.~/.m2),./gradlew testpasses,league.relixincluded.