Allow to override suppression key for inspections

This commit is contained in:
Nikolay Krasko
2015-12-11 21:24:20 +03:00
committed by Nikolay Krasko
parent 8196621be5
commit 697132561f
16 changed files with 55 additions and 31 deletions
+3
View File
@@ -0,0 +1,3 @@
@file:Suppress("UnusedImport")
import java.io.* // unused
@@ -0,0 +1,7 @@
@Suppress("warnings")
val Any.v: Int
get() = 123
@Suppress("unused")
val Any.v1: Int
get() = 123
@@ -2,13 +2,13 @@ class Klass {
fun unusedFun() {
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun unusedNoWarn() {
}
}
@Suppress("UnusedSymbol")
@Suppress("unused")
class OtherKlass {
fun unusedNoWarn() {
+2 -2
View File
@@ -3,13 +3,13 @@ fun outer() {
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun localNoWarn() {
}
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun otherFun() {
fun localNoWarn() {
@@ -3,7 +3,7 @@ class Klass {
fun f() {
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun fNoWarn() {}
val p = 5
@@ -19,17 +19,17 @@ class Klass {
fun f() {
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun fNoWarn() {}
val p = 5
}
fun localObject3() = @Suppress("UnusedSymbol") object {
fun localObject3() = @Suppress("unused") object {
fun fNoWarn() {}
}
@Suppress("UnusedSymbol")
@Suppress("unused")
private val localObject4 = object {
fun fNoWarn() {}
}
@@ -14,13 +14,13 @@ fun main(args: Array<String>) {
fun f() {
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun fNoWarn() {}
val p = 5
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun localObject3() = object {
fun fNoWarn() {}
}
@@ -3,13 +3,13 @@ fun main(args: Array<String>) {
fun f() {
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun fNoWarn() {}
val p = 5
}
@Suppress("UnusedSymbol")
@Suppress("unused")
class OtherClass {
fun fNoWarn() {}
}
@@ -19,7 +19,7 @@ fun main(args: Array<String>) {
LocalClass().p
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun other() {
class OtherClass {
fun fNoWarn() {}
@@ -7,5 +7,5 @@ fun onlyInImport() {
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun onlyInImportNoWarn() {}
@@ -2,5 +2,5 @@ fun unusedFun() {
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun unusedNoWarn() {}
@@ -2,7 +2,7 @@ fun usedOnlyRecursively() {
usedOnlyRecursively()
}
@Suppress("UnusedSymbol")
@Suppress("unused")
fun usedOnlyRecursivelyNoWarn() {
usedOnlyRecursivelyNoWarn()
}
@@ -0,0 +1,7 @@
package suppressed
@Suppress("InvalidBundleOrProperty")
fun testSuppressedOnFun() {
K.message("foo.bar")
J.message("foo.bar")
}
@@ -1,4 +1,4 @@
// "Suppress 'KotlinUnusedImport' for file ${file}" "true"
// "Suppress 'UnusedImport' for file ${file}" "true"
import<caret> java.io.*
@@ -1,6 +1,6 @@
// "Suppress 'KotlinUnusedImport' for file ${file}" "true"
// "Suppress 'UnusedImport' for file ${file}" "true"
@file:Suppress("KotlinUnusedImport")
@file:Suppress("UnusedImport")
import java.io.*