Uh oh!
There was an error while loading. Please reload this page.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to force equals alignment? I think we do that about 1/3 of the time, and 2/3 we don't? I'd most like to allow it, if that's a choice.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll take a look at what options are available on
EqualSignAlignment.full disclosure: i am biased toward always aligning consecutive assignments, feeling that it's more readable.
at some point though, I started favoring the forcing of alignment in order to force a standard, hoping to avoid any given chunk of code from churning back and forth between alignment and non-alignment, entirely depending on the last developer's IDE auto-format settings or personal preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to allow equal sign alignment only as optional, then auto-correction could look worse than without auto-correction. this is because optional alignment allows for "over-spaced" statements while desiring to reduce only "under-spaced" statements. e.g.,
experimentally the difference between the two settings of
ForceEqualSignAlignmentis as follows:a setting of

ForceEqualSignAlignment: falsewill remove extra spacing from "under-spaced" statements (which may be worse than leaving it alone) and do nothing about "over-spaced" statementswhereas a setting of

ForceEqualSignAlignment: truewill align both "under-spaced" and "over-spaced" statementsthis example was actually inspired by a section of code that shows why I prefer forcing a standard over enforcing no standard, and how distracting it can be when reading and/or reviewing code.
https://github.com/Invoca/web/blob/748b6c1e2a9de442b9bd8f1d408fc25581a1d5ed/app/controllers/concerns/campaigns/affiliate_campaign_summary.rb#L81-L83