https://github.com/kyaak/danger-warnings_next_generation
Generate overview and detail reports for code analysis results
https://github.com/kyaak/danger-warnings_next_generation
codeanalysis danger danger-plugin jenkins jenkins-ci reporting warnings warnings-next-generation warnings-ng
Last synced: 4 months ago
JSON representation
Generate overview and detail reports for code analysis results
- Host: GitHub
- URL: https://github.com/kyaak/danger-warnings_next_generation
- Owner: Kyaak
- License: mit
- Created: 2019-05-06T20:51:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-28T10:03:24.000Z (over 6 years ago)
- Last Synced: 2025-05-24T19:43:28.744Z (5 months ago)
- Topics: codeanalysis, danger, danger-plugin, jenkins, jenkins-ci, reporting, warnings, warnings-next-generation, warnings-ng
- Language: Ruby
- Homepage:
- Size: 120 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
danger-warnings_next_generation
This [danger](https://github.com/danger/danger) plugin generates overview and detail reports for code analysis results. :detective:
This plugin is inspired and works only with the jenkins [warnings-ng-plugin](https://github.com/jenkinsci/warnings-ng-plugin) :bowing_man:
To avoid an overload of issues in the pull request, only issues for changed files are listed.
The overview report will always contain the number of total, new and fixed issues.## How it looks like
### Warnings Next Generation Overview
|**Tool**|:beetle:|:x:|:white_check_mark:|
|:---|:---:|:---:|:---:|
|Android Lint Warnings|10|0|3|
|PMD Warnings|:star:|0|0|
|Detekt Warnings|10|5|5|
|Checkstyle Warnings|:star:|0|3|### Java Warnings
|**Severity**|**File**|**Description**|
|---|---|---|
|NORMAL|ProductDetailPageFragment.kt:135|[Deprecation] 'getColor(Int): Int' is deprecated. Deprecated in Java|
|NORMAL|ImageGalleryFragment.kt:40|Type mismatch: inferred type is java.util.ArrayList? but kotlin.collections.ArrayList /* = java.util.ArrayList */ was expected|
|NORMAL|MyUtil.java:5|[Design - HideUtilityClassConstructorCheck] 'getColor(Int): Int' is deprecated. Deprecated in Java|### As inline
```text
Android Lint Warnings - NORMAL
[Correctness - GradleDependency]
Obsolete Gradle Dependency A newer version of com.android.support:design than 27.1.1 is available: 28.0.0 This detector looks for usages of libraries where the version you are using is not the current stable release. Using older versions is fine, and there are cases where you deliberately want to stick with an older version. However, you may simply not be aware that a more recent version is available, and that is what this lint check helps find.
```## Installation
$ gem install danger-warnings_next_generation
## Usage
Show overview and tool reports for all found analytic tools.
warnings_next_generation.reportShow overview and tool reports for selected analytic tools
warnings_next_generation.report(
# must match tool id
include: ['android-lint', 'java', 'pmd']
)Show overview and tool reports with inline comments
warnings_next_generation.report(
inline: true,
# inline comments require a baseline
# file: "/var/lib/jenkins/workspace/projectname/repository/app/src/main/java/com/projectname/b2bshop/fragment/gallery/ImageGalleryFragment.kt
# baseline: "/var/lib/jenkins/workspace/projectname/repository/
baseline: '/path/to/workspace/repository/root'
)Only overview report
warnings_next_generation.overview_report(
include: ['java']
)Only tools report
warnings_next_generation.tools_report(
include: ['java', 'pmd']
inline: true,
baseline: '/path/to/workspace/repository/root'
)## Authentication
If you run a jenkins server with required authentication you can pass them to `danger-warnings_next_generation`.
Create an API token with your CI user and do not pass normal password credentials.Run all with authentication
warnings_next_generation.report(
auth_user: "jenkins",
auth_token: "MY_TOKEN"
)Run overview with authentication
warnings_next_generation.overview_report(
auth_user: "jenkins",
auth_token: "MY_TOKEN"
)## Comments threshold
You can switch from inline comments to table comment if all issues >= threshold or to warnings if >= table threshold
Switch to table comment if combined issues size >= 15
warnings_next_generation.report(
inline: true
inline_threshold: 15
)Switch to table comment if combined issues size >= 200
warnings_next_generation.report(
table_threshold: 200
)Switch from inline comment to table, and automatically to warning.
warnings_next_generation.report(
inline: true
inline_threshold: 20
table_threshold: 200
)