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

[Fix #3394] Separate Array & Hash Literal Comma configuration #5307

Merged

Conversation

garettarrowood
Copy link
Contributor

@garettarrowood garettarrowood commented Dec 24, 2017

Resolves #3394 by splitting Style/TrailingCommaInLiteral into Style/TrailingCommaInArrayLiteral & Style/TrailingCommaInHashLiteral. Users can now configure each datatype however they please.

The splitting process was made easy because its tests isolated either hashes OR arrays. All tests from Style/TrailingCommaInLiteral were moved into these new test files.

Since this adds two new cops and the next release is slated to be a patch, I have not updated the CHANGELOG.md. When the time comes, I will attend to the last checkbox.


  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run rake default or rake parallel. It executes all tests and RuboCop for itself, and generates the documentation.

@@ -40,35 +40,17 @@ module Style
# 1,
# 2
# ]
class TrailingCommaInLiteral < Cop
include ArraySyntax
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ArraySyntax was getting unnecessarily included.

@bbatsov
Copy link
Collaborator

bbatsov commented Dec 25, 2017

Since this adds two new cops and the next release is slated to be a patch, I have not updated the CHANGELOG.md. When the time comes, I will attend to the last checkbox.

👍

@garettarrowood garettarrowood force-pushed the separate_trailing_comma_in_literal_cop branch from b2d6e7c to 6678924 Compare December 27, 2017 14:31
@bbatsov bbatsov merged commit ea711b8 into rubocop:master Dec 27, 2017
@garettarrowood garettarrowood deleted the separate_trailing_comma_in_literal_cop branch December 27, 2017 16:10
kevin-j-m added a commit to TheGnarCo/gnar-style that referenced this pull request Mar 5, 2018
Rubocop 0.53.0 created two new cops for controlling trailing comma style
preferences for commas and hashes which may be found here:
rubocop/rubocop#5307.

This removes the `Style/TrailingCommaInLiteral` cop in favor of these
more granular cops.

As a result of this change, gnar-style needs to be updated to use the
new cops and remove the use of the old one. This updates to use the new
cops and updates the gemspec to reflect that this now requires 0.53 of
rubocop in this version to adhere to the available cops.
kevin-j-m added a commit to TheGnarCo/gnar-style that referenced this pull request Mar 5, 2018
Rubocop 0.53.0 created two new cops for controlling trailing comma style
preferences for arrays and hashes which may be found here:
rubocop/rubocop#5307.

This removes the `Style/TrailingCommaInLiteral` cop in favor of these
more granular cops.

As a result of this change, gnar-style needs to be updated to use the
new cops and remove the use of the old one. This updates to use the new
cops and updates the gemspec to reflect that this now requires 0.53 of
rubocop in this version to adhere to the available cops.
firewalker06 added a commit to cookpad/global-style-guides that referenced this pull request Mar 29, 2018
`Style/TrailingCommaInLiteral` has been splitted into `Style/TrailingCommaInArrayLiteral` & `Style/TrailingCommaInHashLiteral`  rubocop/rubocop#5307
kibitan added a commit to kibitan/mastodon that referenced this pull request May 10, 2018
RuboCop doesn't work by following error.

```
$ rubocop
Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead.
(obsolete configuration found in .rubocop.yml, please update it)
```

it comes from RuboCop 0.53.0 [\[Fix mastodon#3394\] Separate Array & Hash Literal Comma configuration by garettarrowood · Pull Request mastodon#5307 · bbatsov/rubocop](rubocop/rubocop#5307)
Gargron pushed a commit to mastodon/mastodon that referenced this pull request Jun 4, 2018
* fix RuboCop error

RuboCop doesn't work by following error.

```
$ rubocop
Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead.
(obsolete configuration found in .rubocop.yml, please update it)
```

it comes from RuboCop 0.53.0 [\[Fix #3394\] Separate Array & Hash Literal Comma configuration by garettarrowood · Pull Request #5307 · bbatsov/rubocop](rubocop/rubocop#5307)

* ci(CodeClimate): specify RuboCop version 0.54

 * https://docs.codeclimate.com/docs/rubocop#section-using-rubocop-s-newer-versions
 * [RuboCop 0.55.0 is not available yet](codeclimate/codeclimate-rubocop#121) on CodeClimate rubocop channel
lawremipsum pushed a commit to lawremipsum/mspsocial-mastodon that referenced this pull request Jul 7, 2018
* fix RuboCop error

RuboCop doesn't work by following error.

```
$ rubocop
Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead.
(obsolete configuration found in .rubocop.yml, please update it)
```

it comes from RuboCop 0.53.0 [\[Fix mastodon#3394\] Separate Array & Hash Literal Comma configuration by garettarrowood · Pull Request mastodon#5307 · bbatsov/rubocop](rubocop/rubocop#5307)

* ci(CodeClimate): specify RuboCop version 0.54

 * https://docs.codeclimate.com/docs/rubocop#section-using-rubocop-s-newer-versions
 * [RuboCop 0.55.0 is not available yet](codeclimate/codeclimate-rubocop#121) on CodeClimate rubocop channel
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

2 participants