Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint for trailing comma in multi line arrays #5444

Merged
merged 1 commit into from
May 15, 2024

Conversation

jrjohnson
Copy link
Member

This makes diffs when an item is added to an array much easier to read. There are a few places where the comma had to be added to a multi line array with a single element, but I'm ok with the trade off.

Inspired by @michaelchadwick's PR comment about this: #5442 (comment) and turned out to be super easy to lint for and auto fix.

This makes diffs when an item is added to an array much easier to read.
There are a few places where the comma had to be added to a multi line
array with a single element, but I'm ok with the trade off.
@jrjohnson jrjohnson marked this pull request as ready for review May 9, 2024 00:25
@jrjohnson jrjohnson requested a review from stopfstedt as a code owner May 9, 2024 00:25
@michaelchadwick
Copy link
Contributor

I wasn't sure about this initially, but the whole "makes diffs cleaner" reason actually makes a lot of sense.

My only remaining qualm was an interpreter/compilation one, because I wasn't sure if PHP, let alone any other language, would flag it as invalid. Apparently, PHP (and many other languages) is OK with this! I just wasn't in the know, but now I'm a total convert.

Copy link
Contributor

@michaelchadwick michaelchadwick left a comment

Choose a reason for hiding this comment

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

I checked a few dozen of these to make sure they looked legit, and they do. Shove off, captain.

Copy link
Member

@stopfstedt stopfstedt left a comment

Choose a reason for hiding this comment

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

nice.

@dartajax dartajax merged commit 7c88647 into ilios:master May 15, 2024
31 checks passed
@jrjohnson jrjohnson deleted the multiline-array-comma-lint branch May 15, 2024 23:55
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.

None yet

4 participants