mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#1064 Provide a switch to turn off CheckStyle on generated test sources
This commit is contained in:
parent
6d99f7b8f3
commit
7e6fee8714
@ -182,11 +182,15 @@ abstract class CompilingExtension implements BeforeEachCallback {
|
|||||||
assertDiagnostics( actualResult.getDiagnostics(), expectedResult.getDiagnostics() );
|
assertDiagnostics( actualResult.getDiagnostics(), expectedResult.getDiagnostics() );
|
||||||
assertNotes( actualResult.getNotes(), expectedResult.getNotes() );
|
assertNotes( actualResult.getNotes(), expectedResult.getNotes() );
|
||||||
|
|
||||||
if ( !findAnnotation( testClass, DisableCheckstyle.class ).isPresent() ) {
|
if ( !findAnnotation( testClass, DisableCheckstyle.class ).isPresent() && !skipCheckstyleBySystemProperty() ) {
|
||||||
assertCheckstyleRules();
|
assertCheckstyleRules();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean skipCheckstyleBySystemProperty() {
|
||||||
|
return Boolean.parseBoolean( System.getProperty( "checkstyle.skip" ) );
|
||||||
|
}
|
||||||
|
|
||||||
private void assertCheckstyleRules() throws Exception {
|
private void assertCheckstyleRules() throws Exception {
|
||||||
if ( sourceOutputDir != null ) {
|
if ( sourceOutputDir != null ) {
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user