-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Enable Style/Encoding for Ruby >= 2.0 #1304
Comments
I agree the current behaviour is less than ideal.
Perhaps. Alternative we can just remove the Ruby 2.0 check and make the cop disabled by default, which sounds like a better idea to me. @yujinakayama @jonas054 Thoughts? |
I would suggest adding a new configuration parameter: Style/Encoding:
# If false, checks are only made when running under Ruby 1.9.
ForAllRubyVersions: false Disabling the cop doesn't really solve this issue, and adding a |
Unless a project supports 1.9, running the cop makes zero sense. If a project supports 1.9 than the existing configs - |
I agree. I've also been thinking the current Also, we've forgotten to add encoding comments several times carelessly, but it's something we want to automate with RuboCop. By the way, though I have no strong opinion on whether it should be enabled by default or not, the maintenance support for Ruby 1.9.3 will end on Feb 23, 2015. |
@bbatsov When you said "remove the Ruby 2.0 check", I read it as "remove the check when running Ruby 2.0". So forget what I said. I agree with what you actually said. |
`Style/Encoding` cop is disabled by default from RuboCop v0.26.0. See rubocop/rubocop#1304.
Though I mainly develop and use RuboCop on Ruby 2.1, I want to force to use
# encoding: utf-8
comment on every file for Ruby 1.9 compatibility. But now RuboCop doesn't do anything with Ruby 2.0.Style/Encoding
cop hasSupportedStyles
asalways
andwhen_needed
so I thought cop registers an offense for every Ruby version when I setalways
toEnforcedStyle
, for Ruby < 2.0 when I setwhen_needed
toEnforcedStyle
. But it doesn't mean it, it was about content of file.Is there any idea to enable
Encoding
cop for every Ruby version, like adding a style toSupportedStyles
?The text was updated successfully, but these errors were encountered: