checkstyle

Checkstyle plugin for danger-kotlin

Лицензия

Лицензия

Категории

Категории

Checkstyle Тестирование приложения и мониторинг Code Analysis
Группа

Группа

co.uzzu.danger.plugins
Идентификатор

Идентификатор

checkstyle
Последняя версия

Последняя версия

0.2.0
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

checkstyle
Checkstyle plugin for danger-kotlin
Ссылка на сайт

Ссылка на сайт

https://github.com/uzzu/danger-checkstyle-plugin
Система контроля версий

Система контроля версий

https://github.com/uzzu/danger-checkstyle-plugin

Скачать checkstyle

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.dom4j : dom4j jar 2.1.3
jaxen : jaxen jar 1.1.6
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.0

runtime (1)

Идентификатор библиотеки Тип Версия
systems.danger : danger-kotlin-sdk jar 1.2

Модули Проекта

Данный проект не имеет модулей.

Coding Style Released Version

danger-checkstyle-plugin

A Danger Kotlin plugin for reporting checkstyle result.

Setup

  • Install Danger Kotlin
  • Add the following dependency in your Dangerfile.df.kts :
    @file:DependsOn("co.uzzu.danger.plugins:checkstyle:0.2.0")
  • Register plugin and then write script to report your checkstyle result.
    import co.uzzu.danger.plugins.checkstyle.CheckStyle
    import systems.danger.kotlin.Danger
    import systems.danger.kotlin.register
    
    register plugin CheckStyle
    
    // :

Examples

Simple use

@file:DependsOn("co.uzzu.danger.plugins:checkstyle:0.2.0")

import co.uzzu.danger.plugins.checkstyle.CheckStyle
import systems.danger.kotlin.Danger
import systems.danger.kotlin.register

register plugin CheckStyle

val d = Danger(args)

CheckStyle.report("path/to/checkstyle_result.xml")

Use with glob matcher

@file:DependsOn("co.uzzu.danger.plugins:checkstyle:0.2.0")

import co.uzzu.danger.plugins.checkstyle.CheckStyle
import systems.danger.kotlin.Danger
import systems.danger.kotlin.register

register plugin CheckStyle

val d = Danger(args)

CheckStyle.report("glob:**/path/to/*check_result.xml")

Use with configuration block

@file:DependsOn("co.uzzu.danger.plugins:checkstyle:0.2.0")

import co.uzzu.danger.plugins.checkstyle.CheckStyle
import systems.danger.kotlin.Danger
import systems.danger.kotlin.register

register plugin CheckStyle

val d = Danger(args)

CheckStyle.report {
    // Set configuration properties 
    // :

    // [Required] Set path to checkstyle result file.
    path = "path/to/checkstyle_result.xml"
}

Configuration

You can customize reporting styles as you needed by using configuration scope. The CheckStyle plugin object also has same properties, and these properties are used as default of configuration scope.

reporter

Determinate the reporting style. You can choose the following reporter.

Inline

Report as inline comment You can choose reporting method MESSAGE, WARN, and FAIL .

import co.uzzu.danger.plugins.checkstyle.Inline
import co.uzzu.danger.plugins.checkstyle.ReportMethod.*

CheckStyle.reporter = Inline // reporterMethod = ERROR is used by default.
CheckStyle.reporter = Inline { reportMethod = WARN }

Markdown

Report as message with the Markdown format.

import co.uzzu.danger.plugins.checkstyle.Markdown

CheckStyle.reporter = Markdown // label = "Checkstyle" is used by default.
CheckStyle.reporter = Markdown { label =  "My checkstyle" }

severities

Determinate list of the checkstyle severities(ERROR, IGNORE, INFO, WARNING ) to report. Only ERROR is reported by default.

import co.uzzu.danger.plugins.checkstyle.Severity.*

CheckStyle.severities = listOf(ERROR, IGNORE, INFO, WARNING)

basePath

Determinate base of check style result file path. The working directory is used by default.

CheckStyle.basePath = "path/to/your/base/directory"

License

Apache 2.0 License

Версии библиотеки

Версия
0.2.0
0.1.0