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
Limit annotation line length to 80 characters #192
Comments
I'll be happy to accept a PR :-) |
I was actually thinking about how to implement this while writing the issue report. Since there isn't really any good way of dividing lines, without having readability suffer, it might be a good idea if we could set a wrapper for the annotation. Rubocop for example allows a small wrapper that disables named scanners for that part of the code. I'll see if I get a chance of implementing this later on. |
I also use rubocop and have the exact same issue. I would love the wrappers idea. I currently have to go and replace the rubocop disable wrapper comments every time the annotations update. |
👍 |
1 similar comment
👍 |
Would it be possible to add a configuration option for comment template in the meantime so we could put the necessary |
And a |
Looked into implementing this myself and shortly after getting it all to work I realized #225 exists 😄 @CyborgMaster if you run |
@glittershark, that's pretty awesome!!! Thanks for the tip. I'll try it now. |
@glittershark @CyborgMaster Thank you for this. I did found an issue, the initial annotation added the |
Yes, we have that too. There seems to be a bug where the rake task tied to the migrations seems to skip all the configuration. If I run |
@CyborgMaster Thanks! |
Currently annotate doesn't really care about how long the annotated lines are. Since I'm a bit pedantic and like to keep running rubocop over my source files, I keep hitting a problem with certain models where annotations exceed the line length of 80 characters.
Since 80 characters is a common practice in many places it would be nice if annotate_models also had an option to limit the line length.
Also, it's worth mentioning that while there are ways to avoid this in models, the annotations in routes are pretty consistently over 80 characters. There is no real way of avoiding this, except not annotating routes.
The text was updated successfully, but these errors were encountered: