You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -139,6 +140,39 @@ Spotless requires JRE 11+ and Gradle 6.1.1 or newer.
139
140
- If you're stuck on JRE 8, use [`id 'com.diffplug.spotless' version '6.13.0'` or older](https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md#6130---2023-01-14).
140
141
- If you're stuck on an older version of Gradle, [`id 'com.diffplug.gradle.spotless' version '4.5.1'` supports all the way back to Gradle 2.x](https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md#451---2020-07-04).
141
142
143
+
### Linting
144
+
145
+
Starting in version `7.0.0`, Spotless now supports linting in addition to formatting. To Spotless, all lints are errors which must be either fixed or suppressed. Lints show up like this:
Resolve these lints or suppress with `suppressLintsFor`
155
+
```
156
+
157
+
To suppress lints, you can do this:
158
+
159
+
```gradle
160
+
spotless {
161
+
suppressLintsFor { // applies to all formats
162
+
file = 'src/blah/blah'
163
+
}
164
+
kotlin {
165
+
ktfmt()
166
+
suppressLintsFor { // applies to only the kotlin formats
167
+
step = 'ktlint'
168
+
shortCode = 'rename'
169
+
}
170
+
}
171
+
}
172
+
```
173
+
174
+
Spotless is primarily a formatter, _not_ a linter. In our opinion, a linter is just a broken formatter. But formatters do break sometimes, and representing these failures as lints that can be suppressed is more useful than just giving up.
0 commit comments