diff --git a/buildSrc/src/main/groovy/org.lflang.java-conventions.gradle b/buildSrc/src/main/groovy/org.lflang.java-conventions.gradle index 9fc4fa50f9..1cfe2f3f7d 100644 --- a/buildSrc/src/main/groovy/org.lflang.java-conventions.gradle +++ b/buildSrc/src/main/groovy/org.lflang.java-conventions.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'com.diffplug.spotless' id 'org.lflang.platform' + id 'checkstyle' } repositories { @@ -43,3 +44,15 @@ configurations.all { } } } + +checkstyle { + toolVersion = "${checkstyleToolVersion}" + ignoreFailures = false + configFile = rootProject.file("config/checkstyle/google_checks.xml") +} + +tasks.withType(Checkstyle) { + exclude { FileTreeElement el -> + return el.file.absolutePath.contains('src-gen') || el.file.absolutePath.contains('test-gen') || el.file.absolutePath.contains('build') + } +} diff --git a/config/checkstyle/google_checks.xml b/config/checkstyle/google_checks.xml new file mode 100644 index 0000000000..b5341b964b --- /dev/null +++ b/config/checkstyle/google_checks.xml @@ -0,0 +1,383 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gradle.properties b/gradle.properties index 4b062644e0..fe779bb05a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,6 +21,7 @@ xtextVersion=2.31.0 klighdVersion=2.3.0.v20230606 freehepVersion=2.4 swtVersion=3.124.0 +checkstyleToolVersion=10.12.3 [manifestPropertyNames] org.eclipse.xtext=xtextVersion