violation-comments-lib

Library that adds violation comments from static code analysis to pull requests.

License

License

GroupId

GroupId

se.bjurr.violations
ArtifactId

ArtifactId

violation-comments-lib
Last Version

Last Version

1.106.1
Release Date

Release Date

Type

Type

jar
Description

Description

violation-comments-lib
Library that adds violation comments from static code analysis to pull requests.
Project URL

Project URL

https://github.com/tomasbjerre/violation-comments-lib
Source Code Management

Source Code Management

https://github.com/tomasbjerre/violation-comments-lib

Download violation-comments-lib

How to add to project

<!-- https://jarcasting.com/artifacts/se.bjurr.violations/violation-comments-lib/ -->
<dependency>
    <groupId>se.bjurr.violations</groupId>
    <artifactId>violation-comments-lib</artifactId>
    <version>1.106.1</version>
</dependency>
// https://jarcasting.com/artifacts/se.bjurr.violations/violation-comments-lib/
implementation 'se.bjurr.violations:violation-comments-lib:1.106.1'
// https://jarcasting.com/artifacts/se.bjurr.violations/violation-comments-lib/
implementation ("se.bjurr.violations:violation-comments-lib:1.106.1")
'se.bjurr.violations:violation-comments-lib:jar:1.106.1'
<dependency org="se.bjurr.violations" name="violation-comments-lib" rev="1.106.1">
  <artifact name="violation-comments-lib" type="jar" />
</dependency>
@Grapes(
@Grab(group='se.bjurr.violations', module='violation-comments-lib', version='1.106.1')
)
libraryDependencies += "se.bjurr.violations" % "violation-comments-lib" % "1.106.1"
[se.bjurr.violations/violation-comments-lib "1.106.1"]

Dependencies

compile (3)

Group / Artifact Type Version
se.bjurr.violations : violations-lib jar 1.144.3
org.slf4j : slf4j-api jar 1.7.22
com.github.spullara.mustache.java : compiler jar 0.9.5

Project Modules

There are no modules declared in this project.

Violation Comments Lib

Build Status Maven Central

This is a library that helps working with comments from static code analysis.

It supports the same formats as Violations Lib.

It is used by these libraries:

Template

It uses a template to render each violation comment. There is a default that can be replaced with a custom template.

The context available when the template is rendered is:

The templating language is Mustache and may look like:

**Reporter**: {{violation.reporter}}{{#violation.rule}}

**Rule**: {{violation.rule}}{{/violation.rule}}
**Severity**: {{violation.severity}}
**File**: {{changedFile.filename}} L{{violation.startLine}}{{#violation.source}}

**Source**: {{violation.source}}{{/violation.source}}

{{violation.message}}

You can avoid escaping (replaces new lines with &#10;) by using triple { like this:

{{{violation.message}}}

When using command line tools you may have problems with the ` (accent) character. You can do:

...
-comment-template "
message: 
\\\`\\\`\\\`
{{{violation.message}}}
\\\`\\\`\\\`
"

And it will surround the message with triple ```.

Versions

Version
1.106.1
1.105
1.104
1.103
1.102
1.101
1.100
1.99
1.98
1.97
1.96
1.95
1.94
1.93
1.92
1.91
1.90
1.89
1.88
1.87
1.86
1.85
1.84
1.83
1.82
1.81
1.80
1.79
1.78
1.77
1.76
1.75
1.74
1.73
1.72
1.71
1.70
1.69
1.68
1.67
1.66
1.65
1.64
1.63
1.62
1.60
1.59
1.58
1.57
1.56
1.55
1.54
1.53
1.52
1.51
1.50
1.49
1.48
1.47
1.46
1.45
1.44
1.43
1.42
1.41
1.40
1.39
1.38
1.37
1.36
1.35
1.34
1.33
1.32
1.31
1.30
1.29
1.28
1.27
1.26
1.25
1.24
1.23
1.22
1.21
1.20
1.19
1.18
1.17
1.16
1.15
1.14
1.13
1.12
1.11
1.10
1.9
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0