Code Monkey home page Code Monkey logo

lintrules's Introduction

Metrics

lintrules's People

Contributors

chesire avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Watchers

 avatar  avatar

lintrules's Issues

Flag up usage of Assert

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].

Lexicographic dependencies has issue with nested modules

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.

Lexicographic ordering can seem a bit off

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.

Add lint rule for double new line

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

Remove the Lexicographic Gradle dependency exclusion

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.

Add warning for using ' as opposed to " in gradle files

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.

Paths with multiple sections are flagged as duplicated

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.

Duplicate dependencies can fire across files

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.