Can be private -> could be private (violation of naming convention)
This commit is contained in:
+1
-1
@@ -153,7 +153,7 @@ class MemberVisibilityCanBePrivateInspection : AbstractKotlinInspection() {
|
|||||||
val nameElement = (declaration as? PsiNameIdentifierOwner)?.nameIdentifier ?: return
|
val nameElement = (declaration as? PsiNameIdentifierOwner)?.nameIdentifier ?: return
|
||||||
holder.registerProblem(
|
holder.registerProblem(
|
||||||
declaration.visibilityModifier() ?: nameElement,
|
declaration.visibilityModifier() ?: nameElement,
|
||||||
"$member '${declaration.getName()}' can be private",
|
"$member '${declaration.getName()}' could be private",
|
||||||
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
IntentionWrapper(AddModifierFix(modifierListOwner, KtTokens.PRIVATE_KEYWORD), declaration.containingKtFile)
|
IntentionWrapper(AddModifierFix(modifierListOwner, KtTokens.PRIVATE_KEYWORD), declaration.containingKtFile)
|
||||||
)
|
)
|
||||||
|
|||||||
+14
-14
@@ -5,7 +5,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Property 'a' can be private</description>
|
<description>Property 'a' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Function 'f1' can be private</description>
|
<description>Function 'f1' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Function 'f2' can be private</description>
|
<description>Function 'f2' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Property 'y' can be private</description>
|
<description>Property 'y' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Function 'f2' can be private</description>
|
<description>Function 'f2' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Property 'a' can be private</description>
|
<description>Property 'a' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Property 'b' can be private</description>
|
<description>Property 'b' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Property 'c' can be private</description>
|
<description>Property 'c' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="test.kt" />
|
<entry_point TYPE="file" FQNAME="test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can have 'private' visibility</problem_class>
|
||||||
<description>Property 'bar' can be private</description>
|
<description>Property 'bar' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
||||||
<description>Property 'a' can be private</description>
|
<description>Property 'a' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
||||||
<description>Property 'b' can be private</description>
|
<description>Property 'b' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
||||||
<description>Function 'c' can be private</description>
|
<description>Function 'c' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
||||||
<description>Property 'b' can be private</description>
|
<description>Property 'b' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
@@ -123,6 +123,6 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Class member can have 'private' visibility</problem_class>
|
||||||
<description>Function 'c' can be private</description>
|
<description>Function 'c' could be private</description>
|
||||||
</problem>
|
</problem>
|
||||||
</problems>
|
</problems>
|
||||||
|
|||||||
Reference in New Issue
Block a user