forked from apache/iceberg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
baseline.gradle
99 lines (91 loc) · 3.81 KB
/
baseline.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
apply plugin: 'com.palantir.baseline-config'
allprojects {
apply plugin: 'com.palantir.baseline-idea'
}
subprojects {
// Currently, if any subproject applies the blanket Baseline plugin, it forces the Baseline plugin
// to be applied to ALL projects. And we are not prepared to address all of the build errors that
// occur as a result at this time. Furthermore, baseline-format will not work out of the box for
// us - see below.
// Thus we concede to applying all of the Baseline plugins individually on all the projects we are
// ready to enforce linting on.
apply plugin: 'org.inferred.processors'
if (!project.hasProperty('quick')) {
apply plugin: 'com.palantir.baseline-checkstyle'
apply plugin: 'com.palantir.baseline-error-prone'
}
apply plugin: 'com.palantir.baseline-class-uniqueness'
apply plugin: 'com.palantir.baseline-reproducibility'
apply plugin: 'com.palantir.baseline-exact-dependencies'
apply plugin: 'com.palantir.baseline-release-compatibility'
apply plugin: 'com.diffplug.spotless'
// Can't use the built-in Baseline spotless format because it's opinionated about the import
// order of having static imports after non-static imports, and this cannot be overridden.
// So we apply Spotless manually to get a similar effect to baseline-format, but change the
// import order.
pluginManager.withPlugin('com.diffplug.spotless') {
spotless {
// don't run spotlessCheck during gradle check task
enforceCheck = false
java {
target 'src/main/java/**/*.java', 'src/test/java/**/*.java', 'src/jmh/java/**/*.java'
removeUnusedImports()
importOrder '', 'static '
trimTrailingWhitespace()
indentWithSpaces 2
endWithNewline()
}
}
}
pluginManager.withPlugin('com.palantir.baseline-error-prone') {
tasks.withType(JavaCompile).configureEach {
options.errorprone.errorproneArgs.addAll (
// error-prone is slow, don't run on tests and generated src
'-XepExcludedPaths:.*/(test|generated-src)/.*',
// specific to Palantir
'-Xep:ConsistentLoggerName:OFF', // Uses name `log` but we use name `LOG`
'-Xep:FinalClass:OFF',
'-Xep:PreferSafeLoggingPreconditions:OFF',
'-Xep:PreferSafeLoggableExceptions:OFF',
'-Xep:Slf4jLogsafeArgs:OFF',
'-Xep:RawTypes:OFF',
// subclasses are not equal
'-Xep:EqualsGetClass:OFF',
// patterns that are allowed
'-Xep:MissingCasesInEnumSwitch:OFF',
//Added because it errors out compile, but we need to figure out if we want it
'-Xep:StrictUnusedVariable:OFF',
'-Xep:TypeParameterShadowing:OFF',
'-Xep:TypeParameterUnusedInFormals:OFF',
)
}
}
pluginManager.withPlugin('com.github.alisiikh.scalastyle') {
scalastyle {
config = file("${rootDir}/project/scalastyle_config.xml")
inputEncoding = 'UTF-8'
outputEncoding = 'UTF-8'
failOnWarning = false
verbose = false
quiet = false
}
}
}