Sha256: 89a5f59fedda5b57cf6bc884eb74624c9451a2d8b2a64bb56cb4cce4dc661cd4

Contents?: true

Size: 1.98 KB

Versions: 1

Compression:

Stored size: 1.98 KB

Contents

# Danger PMD

Danger plugin for PMD formatted xml file. This plugin is inspired from https://github.com/kazy1991/danger-findbugs.

## Installation

    $ gem install danger-pmd

## Usage

    Methods and attributes from this plugin are available in
    your `Dangerfile` under the `pmd` namespace.

<blockquote>Running PMD with its basic configuration
<pre>
pmd.report
</pre>
</blockquote>

<blockquote>Running PMD with a specific Gradle task or report file
<pre>
pmd.gradle_task = 'app:pmd' #defalut: pmd
pmd.report_file = "app/build/reports/pmd/pmd.xml"
pmd.report
</pre>
</blockquote>

#### Attributes

`gradle_module` - Custom Gradle module to run.
This is useful when your project has different flavors.
Defaults to "app".

`gradle_task` - Custom Gradle task to run.
This is useful when your project has different flavors.
Defaults to "pmd".

`report_file` - Location of report file
If your pmd task outputs to a different location, you can specify it here.
Defaults to "app/build/reports/pmd/pmd.xml".

`skip_gradle_task` - Skip Gradle task.
If you skip Gradle task, for example project does not manage Gradle.

#### Methods

`report` - Calls pmd task of your Gradle project.
It fails if `gradlew` cannot be found inside current directory.
It fails if `report_file` cannot be found inside current directory.

`target_files` - A getter for current updated files.

`exec_gradle_task` - Run Gradle task.

`gradlew_exists?` - Check gradlew file exists in current directory.

`report_file_exist?` - Check report_file exists in current directory.

`pmd_report` - A getter for `pmd_report`, returning PMD report.

`pmd_issues` - A getter for PMD issues, returning PMD issues.

`send_inline_comment` - Send inline comment with danger's warn or fail method.

`skip_gradle_task` - Skip Gradle task.

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danger-pmd-0.0.5 README.md