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

Snake Case cop too strong : incompatible with private_constant #389

Closed
badal opened this issue Jul 23, 2013 · 2 comments · Fixed by #416
Closed

Snake Case cop too strong : incompatible with private_constant #389

badal opened this issue Jul 23, 2013 · 2 comments · Fixed by #416
Assignees
Labels

Comments

@badal
Copy link

badal commented Jul 23, 2013

Example :

ADMIN_MODE = ...
private_constant :ADMIN_MODE

raises :

C: Use snake_case for symbols.
  private_constant :ADMIN_MODE
@bbatsov
Copy link
Collaborator

bbatsov commented Jul 24, 2013

Hmm, I think someone else already raised this issue once. I'm not sure I was us to introduce special handling for just a single scenario. Maybe that would make sense if there are other methods expecting a constant referred by a symbol. Or maybe we should this case since it various scenarios snake_case, camelCase (generally when producing json for web APIs), PascalCase and SCREAMING_SNAKE_CASE is employed.

@jonas054 @yujinakayama @edzhelyov Your thoughts?

@jonas054
Copy link
Collaborator

There are many situations in which it is necessary to use symbols that are not snake case, and the normal way of getting rid of the reports will have to be turning off the SymbolName cop locally with comments or configuration files. However, since this case is related to a feature in Ruby and not to a particular application, I think it's reasonable to implement special handling of it in RuboCop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants