Bug 509967 - Add support for conditional checkstyle off with @SuppressWarnings
Summary: Add support for conditional checkstyle off with @SuppressWarnings
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Releng (show other bugs)
Version: 4.1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 5.0.0   Edit
Assignee: Pierre-Charles David CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-01-05 04:46 EST by Stephane Begaudeau CLA
Modified: 2017-06-29 03:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane Begaudeau CLA 2017-01-05 04:46:06 EST
Update the checkstyle configuration to support the conditional removal of checkstyle errors. Instead of this:

// CHECKSTYLE:OFF
...
// CHECKSTYLE:ON

We could thus use:

@SuppressWarnings({ "checkstyle:multiplestringliterals" })
public final class GapPatternGenerator {
    ...
}

It allows the removal of the validation of specific checkstyle errors on a specific Java scope (class, method, field, etc) while keeping all the other kind of check activated.


See: http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarnings#SuppressWarningsHolder
Comment 1 Pierre-Charles David CLA 2017-01-05 04:50:26 EST
Moving to 5.0; we'll probably need to upgrade the version of CheckStyle we use when we start to really use Java 8-specific features, so it will be a good opportunity to review and improve our CheckStyle profile, and this point could be part of it.
Comment 2 Eclipse Genie CLA 2017-01-06 09:25:44 EST
New Gerrit change created: https://git.eclipse.org/r/88169
Comment 4 Pierre-Charles David CLA 2017-02-20 04:23:27 EST
I suppose this can be closed?
Comment 5 Stephane Begaudeau CLA 2017-02-20 04:29:21 EST
Closing this issue since it has been merged
Comment 6 Pierre-Charles David CLA 2017-06-29 03:31:44 EDT
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.