Git Product home page Git Product logo

danger-android_lint's Introduction

CircleCI

danger-android_lint

Lint files of a gradle based Android project.

Installation

Via global gems

$ gem install danger-android_lint

Via Bundler

Add the following line to your Gemfile and then run bundle install:

gem 'danger-android_lint'

Usage

Before all, you need to turn lint reports on in your build.gradle file. You can do this by adding the xmlReport true option, like:

android {
    lintOptions {
        xmlReport true
    }
}

Basic

android_lint.lint

Advanced

Using a custom gradle task

In case you have multiple flavors, you may want to change the gradle task that runs the lint command. You can achieve that by simply changing the value of gradle_task. Default is lint.

android_lint.gradle_task = "lintMyFlavorDebug"
android_lint.lint

If you want to skip gradle task, setting the skip_gradle_task parameter to true.

android_lint.skip_gradle_task = true
android_lint.lint

Changing report's file path

If you're using a path to output your report file other than the default one, you can specify it by setting a new value to report_file:

android_lint.report_file = "your/report/file.xml"
android_lint.lint

Changing report's severity level

If you want to filter lint issues based on their severity level, you can do that by setting a value to severity. Bear in mind that you are filtering issues by the severity level you've set and up. Possible values are Warning, Error and Fatal. Default is Warning (which is everything).

android_lint.severity = "Error"
android_lint.lint

Lint only added/modified files

If you're dealing with a legacy project, with tons of warnings, you may want to lint only new/modified files. You can easily achieve that, setting the filtering parameter to true.

android_lint.filtering = true
android_lint.lint

Make Danger comment directly on the line instead of printing a Markdown table (GitHub only)

android_lint.lint(inline_mode: true)

Development

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.

License

MIT

danger-android_lint's People

Contributors

barbosa avatar rishabhtayal avatar leonhartx avatar litmon avatar jettbow avatar churowa avatar

Watchers

James Cloos avatar

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.