chesire / lintrules Goto Github PK
View Code? Open in Web Editor NEWAdd extra linting rules to Android projects
License: Apache License 2.0
Add extra linting rules to Android projects
License: Apache License 2.0
When defining project dependencies generally it should just be project(":dependencyName")
ensure this gets used instead of project(path: "dependencyName')
Add lint warnings related to the post https://dev.to/dbottillo/dark-mode-three-lint-checks-to-help-b32, some of the ideas here could be useful to integrate as lint rules.
Instead of using Assert.assertFalse
etc, the methods should be static imported into the file so they can be read as just assertFalse
etc.
Rule could be named something like [AssertUsage].
If modules are nested multiple times, it can flag up warnings where there aren't any
implementation project(path: ":libraries:kitsu")
implementation project(path: ":libraries:kitsu:trending")
implementation project(path: ":libraries:library")
implementation project(path: ":libraries:server")
implementation project(path: ":libraries:server:trending")
in this example, implementation project(path: ":libraries:library")
is flagged up as being in the wrong order, but it isn't.
When using the Lexicographic ordering lint rule, since it is completely based on lexicographic ordering it takes into account :
and .
characters, causing an odd order when having multiple libraries from the same person.
ex:
implementation 'com.chesire.lintrules:lint-gradle:1.1.0'
implementation 'com.chesire.lintrules:lint-xml:1.1.0'
implementation 'com.chesire:lifecyklelog:2.1.0'
is valid, whereas
implementation 'com.chesire:lifecyklelog:2.1.0'
implementation 'com.chesire.lintrules:lint-gradle:1.1.0'
implementation 'com.chesire.lintrules:lint-xml:1.1.0'
should be valid instead.
When using layouts other than a ConstraintLayout its possible to add attributes for ConstraintLayout items such constraints. There should be a warning telling the user to not use these as they are not valid.
Gradle files should contain a single new line, a double new line should raise a lint warning.
dependencies {
implementation...
implementation...
}
should be valid, while
dependencies {
implementation...
implementation...
}
should raise a lint warning
There is currently an exclusion on the Kotlin version dependency, this can be removed now as it is no longer required to be set in the Gradle file, so if its still kept around it should be kept lexicographically.
To make the transition to Kotlin gradle files later on, flag up using '
instead of "
. "
should be perfectly valid throughout the Gradle files.
Might need some thoughts on how to handle methods though, as this would only really work for android
and dependencies
blocks.
Adding other projects to the dependencies list flags up the duplicate issue even when they aren't, if they are added using the below syntax.
implementation project(path: ":libraries:database")
implementation project(path: ":libraries:server")
The whole line likely isn't being checked for duplicate dependencies.
Usage of a double space is incorrect, there should only be a single space between attributes.
If lintOptions.checkDependencies true
is set then all of the files are checked in one sweep, this causes it to flag up a duplicate dependency for the files multiple times.
Might be a way to check the file type when running the linting rules to ensure that we only do it in the same file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.