-
Notifications
You must be signed in to change notification settings - Fork 13
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
Ignoring the lines starting with '//' when checking the line length #10
Conversation
…when commenting out a bunch of lines/method it's 50:50 that build fails because some line exceeded 120 chars limit.)
I think this is a mostly good idea - especially when locally trying changes while debugging. For longer term we should be diligent enough to remove those commented artifacts before |
You can make your editor show a print margin and you immediately know if
you're going to fail the build.
And your IDE can also format Javadoc and comments.
|
The issue I am seeing and am referring to is that I write code, deploy and debug it. |
I don't feel the same because my IDE is configured to automatically If you want to defer to Travis for format and license checking it's easy <profiles>
...
<profile>
<id>defer-checks-to-travis</id>
<properties>
<property>license.skip</property>
<property>checkstyle.skip</property>
</properties>
</profile>
...
</profiles> and then <activeProfiles>
...
<activeProfile>defer-checks-to-travis</activeProfile>
...
</activeProfiles> If those checks are a pain for a majority of developers then I'm fine |
I haven't found similar feature to the Eclipse's "format on save" in Idea. I guess it'd be possible to workaround this with some macros, but the main issue is that Idea can't do the proper line wrapping during the code formation. It does it correctly when pasting the code to the IDE or when typing in IDE and the line is longer than the limit, but if you use the Ctrl+/ to comment out a line the line wrapping doesn't work. This is the issue. In ideal world I'd setup an exception for lines starting with '//' to have the line limit to 122, but it's not possible in checkstyle. Using the Just an idea, isn't it possible to hook the checkstyle plugin to the test mvn phase? |
Le 06/03/2015 13:30, Jirka Kremser a écrit :
The day after tomorrow, the new ideal will be 124 :p
I've attached Maven settings snippet in a previous reply which you can
Good idea. I'd say to the "verify" phase actually. Just like the license |
I tend to be against this as there seem to be enough ways either suppress the problem ( {{-Dcheckstyle.skip}} ) or detect (visible print margin in IDE) and solve (reformat) it. |
Well, //
////
////
// ..is not so common pattern. Ok, so I'll close this PR. Let's hook the checkstyle to the verify mvn phase, this seems to be better solution. |
PR sent: see hawkular/hawkular-parent-pom#16 |
Thanks, Thomas |
I think this is a very good solution now in PR 16. |
When commenting out a bunch of lines/method it's 50:50 that build fails because some line exceeded 120 chars limit.
This has also drawback that people can write comments longer than 120 characters, but I think it's worth changing.
Now, all the projects/modules are relatively small and hence the build time is short, but it gets worse and these types of build failures will get, imho, very annoying.