-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Rubocop] Remove line length limit for comments #25
Comments
Hmm not so sure about this. To me, one of the benefits of limiting line length is to have the file look more pretty on editors (by avoiding line wrapping and having all the text in the file more structured). For comments you can just put in into multiple lines, I don't see it as an issue. |
No tengo una opinión clara... Me inclino por simplificar y no tener demasiadas excepciones a las reglas ("80 caracteres, menos los comentarios"). Por otro lado, no me he encontrado con ese problema que comentas @dvdgs88 de los initializers. |
I think that the comments are still part of the code, so I don't really like to make exceptions based on this. My suggestion is to ignore some of this initializers. For example, Devise or ActiveAdmin have initializers that don't comply with the rules from Rubocop. We can make a proposal to ignore all these init files from the Rubocop checks. They weren't written by us. Regarding Rails application.rb, and environmnets/*.rb I think that with the Pathfinder we will have all the problems with styles solved. |
any update on this? Where is the correct place to apply that ignore rule, is the rubocop file a suitable place? |
Personally I would not add any exception. With respect to generated initializers I think it's quite fast to adapt the comments length and it's only once per project, I don't think it takes more than 5 minutes. Thoughts? |
There are also some great gems, such as https://github.com/ctran/annotate_models, that auto-generate comments that offend the line length. Would be great if we could just allow these in Rubocop, but for the rest of our own code, we want to enforce Rubocop. Another use-case are long URLs that we put for reference in a comment. Right now, I either have to mess with some pattern matching in Rubocop, or ignore single files by adding a flag to the line (or ignore the entire file, which is not ideal). |
Solution: https://stackoverflow.com/questions/26342570/rubocop-linelength-how-to-ignore-lines-with-comments
Why? Some usual initializers don't respect this rule and we need fix them to pass rubocop.
The text was updated successfully, but these errors were encountered: