Apply same style for top-level and object properties
#KT-20437 Fixed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>5</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<description>Object or top-level property name <code>_FOO</code> should not start with an underscore #loc</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>21</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<description>Object or top-level property name <code>_FOO</code> should not start with an underscore #loc</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+1
@@ -0,0 +1 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.ObjectPropertyNameInspection
|
||||
@@ -0,0 +1,34 @@
|
||||
val Foo: String = ""
|
||||
|
||||
var FOO_BAR: Int = 0
|
||||
|
||||
var _FOO: Int = 0
|
||||
|
||||
const val THREE = 3
|
||||
|
||||
val xyzzy = 1
|
||||
|
||||
fun foo() {
|
||||
val XYZZY = 1
|
||||
val BAR_BAZ = 2
|
||||
}
|
||||
|
||||
object Foo {
|
||||
val Foo: String = ""
|
||||
|
||||
var FOO_BAR: Int = 0
|
||||
|
||||
var _FOO: Int = 0
|
||||
}
|
||||
|
||||
class D {
|
||||
private val _foo: String
|
||||
|
||||
private val FOO_BAR: String
|
||||
|
||||
companion object {
|
||||
val Foo: String = ""
|
||||
|
||||
var FOO_BAR: Int = 0
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,9 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>1</line>
|
||||
<line>27</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<description>Property name <code>Foo</code> should start with a lowercase letter #loc</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>3</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<description>Property name <code>FOO_BAR</code> should not contain underscores #loc</description>
|
||||
<description>Property name <code>_Foo</code> should not start with an underscore #loc</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -2,6 +2,8 @@ val Foo: String = ""
|
||||
|
||||
var FOO_BAR: Int = 0
|
||||
|
||||
var _FOO: Int = 0
|
||||
|
||||
const val THREE = 3
|
||||
|
||||
val xyzzy = 1
|
||||
@@ -22,6 +24,8 @@ class D {
|
||||
|
||||
private val FOO_BAR: String
|
||||
|
||||
val _Foo: String
|
||||
|
||||
companion object {
|
||||
val Foo: String = ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user