Lint Rules
To help developers discover potential problems at compile time and keep API usage consistent,
Hikageprovides a built-in set of Android Lint rules.
Rule List
The following are all Lint rules currently in effect (Only effective for Kotlin language).
hikage-core
| Issue ID | Category | Severity | Priority | Brief Description |
|---|---|---|---|---|
| MissingHikageAttributeNamespace | CORRECTNESS | ERROR | 6 | Hikage attribute missing namespace. |
| DuplicateHikageAttribute | CORRECTNESS | ERROR | 6 | Hikage attribute duplicate. |
| ReplaceWithHikageAttributeNamespaceShortcuts | USABILITY | WARNING | 5 | Hikage attribute namespace usage. |
| IneffectiveHikageLayoutAttribute | CORRECTNESS | WARNING | 5 | Hikage layout attribute ineffective. |
| CreateIdInHikageAttribute | CORRECTNESS | ERROR | 6 | Hikage attribute creates ID resource. |
| MissingIdInHikageAttribute | CORRECTNESS | ERROR | 6 | Hikage attribute ID resource missing. |
| InvalidHikageAttributeName | CORRECTNESS | ERROR | 6 | Hikage attribute name invalid. |
| InvalidHikageAttributeResourceReference | CORRECTNESS | ERROR | 6 | Hikage attribute resource reference invalid. |
| InvalidHikageAttributeColorValue | CORRECTNESS | ERROR | 6 | Hikage attribute color value invalid. |
| TooLongHikageAttributeString | CORRECTNESS | ERROR | 6 | Hikage attribute string too long. |
| HikagableBeyondScope | CORRECTNESS | ERROR | 10 | Hikagable beyond scope. |
| MissingHikagableAnnotation | CORRECTNESS | ERROR | 10 | Missing @Hikagable annotation. |
| ReplaceWithHikageSafeTypeCast | USABILITY | WARNING | 5 | Hikage safe type cast usage. |
| UseHikageResourcesScope | CORRECTNESS | WARNING | 5 | Hikage resources scope violation. |
| RemoveHikagePerformerAlias | CORRECTNESS | WARNING | 6 | Hikage performer import alias. |
| ReplaceWithGeneratedHikagePerformer | USABILITY | WARNING | 5 | Hikage generated performer function usage. |
How to Disable or Adjust Rules
If you want to disable a specific rule or change its severity, you can create a lint.xml file in the project root.
The following example
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="ReplaceWithGeneratedHikagePerformer" severity="ignore" />
<issue id="ReplaceWithHikageSafeTypeCast" severity="error" />
</lint>
Common severity values are:
ignorewarningerrorfatal
You can also control them directly in Gradle.
The following example
android {
lint {
disable += "ReplaceWithGeneratedHikagePerformer"
warning += "ReplaceWithHikageSafeTypeCast"
error += "MissingHikagableAnnotation"
}
}
If you only want to check part of the rules, you can also use checkOnly.
The following example
android {
lint {
checkOnly += setOf(
"ReplaceWithGeneratedHikagePerformer",
"MissingHikagableAnnotation"
)
}
}
Feedback
Currently, most Lint detectors are completed by AI Agent, and there may still be issues, such as complex UAST scenarios that have not been tested. If you find that a Lint rule is misreporting or the Quick Fix cannot correctly fix the problem during use, you can provide an Issue ID to directly feedback to us on GitHub Issues.
If you think some rules are not reasonable and overly restrictive on the code, or if you have some new rule suggestions, please also feel free to provide feedback to us, and we will evaluate and adjust them.