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

Allow TrailingCommaInLiteral to enforce Arrays but not Hashes #3394

Closed
CyborgMaster opened this issue Aug 9, 2016 · 1 comment
Closed

Allow TrailingCommaInLiteral to enforce Arrays but not Hashes #3394

CyborgMaster opened this issue Aug 9, 2016 · 1 comment

Comments

@CyborgMaster
Copy link

I would like TrailingCommaInLiteral to be enforced for arrays, but not hashes. Could that be done with a configuration option?

@garettarrowood
Copy link
Contributor

garettarrowood commented Dec 24, 2017

Reviewing the cop, I do not believe a new config option is the way to go. There are already no_comma, comma & consistent_comma config options. This looks like a good candidate to break into 2 Cops, TrailingCommaInArrayLiteral & TrailingCommaInHashLiteral. This will allow unique configuration for both data types.

garettarrowood added a commit to garettarrowood/rubocop that referenced this issue Dec 27, 2017
garettarrowood added a commit to garettarrowood/rubocop that referenced this issue Dec 27, 2017
skalee added a commit to skalee/guides that referenced this issue Mar 6, 2018
In Rubocop 0.53, Style/TrailingCommaInLiteral has been replaced with
Style/TrailingCommaInArrayLiteral, and Style/TrailingCommaInHashLiteral.

See: rubocop/rubocop#3394.
nickcharlton pushed a commit to thoughtbot/guides that referenced this issue Mar 13, 2018
* Replace removed Rubocop cop

In Rubocop 0.53, Style/TrailingCommaInLiteral has been replaced with
Style/TrailingCommaInArrayLiteral, and Style/TrailingCommaInHashLiteral.

See: rubocop/rubocop#3394.

* Move Rubocop cop to proper namespace

In Rubocop 0.53, Lint/ConditionPosition has been moved to Layout
namespace.

* Rename Rubocop cop

In Rubocop 0.53, Lint/UnneededDisable has been renamed to
Lint/UnneededCopDisableDirective.
nickcharlton added a commit to nickcharlton/dotfiles that referenced this issue May 20, 2018
* Replace removed Rubocop cop

In Rubocop 0.53, Style/TrailingCommaInLiteral has been replaced with
Style/TrailingCommaInArrayLiteral, and Style/TrailingCommaInHashLiteral.

See: rubocop/rubocop#3394.

* Move Rubocop cop to proper namespace

In Rubocop 0.53, Lint/ConditionPosition has been moved to Layout
namespace.

* Rename Rubocop cop

In Rubocop 0.53, Lint/UnneededDisable has been renamed to
Lint/UnneededCopDisableDirective.

Original: thoughtbot/guides#510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants