pmdtester 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.md +9 -0
- data/lib/pmdtester.rb +1 -1
- data/lib/pmdtester/builders/pmd_report_builder.rb +1 -0
- data/pmdtester.gemspec +3 -3
- data/resources/css/pmd-tester.css +1 -0
- data/resources/js/code-snippets.js +26 -19
- data/resources/js/project-report.js +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d45c31e2cf8ad4eaba391c13fa0523ade4a84394bc07a908e6a49806a12ebf6
|
4
|
+
data.tar.gz: fdf6c23a45dc0fd6738e272e564c3c29322dea2285269c1a869608bd77494d8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 249c6a07412a2b74405e84fe1780d5cdb8fe4173d32438c7c0fab4f78b5852ec1a63654e3a1219b4889c43e931d00451a361d27924dc0978061035abd7d03322
|
7
|
+
data.tar.gz: 3f4f7e4bf61f827ff475d9f302f1b73cf1e43c9807ac5b6aaf364d27bbb774db066f7a7af28586aa29ea2365e2664c915944afcedc2d0a112587f1e1cf0efb8a
|
data/History.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# 1.1.2 / 2021-04-20
|
2
|
+
|
3
|
+
This is a bugfix release.
|
4
|
+
|
5
|
+
## Fixed Issues
|
6
|
+
|
7
|
+
* [#85](https://github.com/pmd/pmd-regression-tester/issues/85): HTML is not escaped in snippet preview
|
8
|
+
* [#84](https://github.com/pmd/pmd-regression-tester/issues/84): Leading spaces are missing in code snippet preview
|
9
|
+
|
1
10
|
# 1.1.1 / 2021-01-15
|
2
11
|
|
3
12
|
This is a bugfix release.
|
data/lib/pmdtester.rb
CHANGED
@@ -32,7 +32,7 @@ require_relative 'pmdtester/parsers/projects_parser'
|
|
32
32
|
# and unexpected behaviors will not be introduced to PMD project
|
33
33
|
# after fixing an issue and new rules can work as expected.
|
34
34
|
module PmdTester
|
35
|
-
VERSION = '1.1.
|
35
|
+
VERSION = '1.1.2'
|
36
36
|
BASE = 'base'
|
37
37
|
PATCH = 'patch'
|
38
38
|
PR_NUM_ENV_VAR = 'PMD_CI_PULL_REQUEST_NUMBER' # see PmdBranchDetail
|
data/pmdtester.gemspec
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake hoe:spec`.
|
2
2
|
|
3
3
|
# -*- encoding: utf-8 -*-
|
4
|
-
# stub: pmdtester 1.1.
|
4
|
+
# stub: pmdtester 1.1.2 ruby lib
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "pmdtester".freeze
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
11
11
|
s.metadata = { "bug_tracker_uri" => "https://github.com/pmd/pmd-regression-tester/issues", "homepage_uri" => "https://pmd.github.io", "source_code_uri" => "https://github.com/pmd/pmd-regression-tester" } if s.respond_to? :metadata=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Andreas Dangel".freeze, "Binguo Bao".freeze, "Cl\u00E9ment Fournier".freeze]
|
14
|
-
s.date = "2021-
|
14
|
+
s.date = "2021-04-20"
|
15
15
|
s.description = "A regression testing tool ensure that new problems and unexpected behaviors will not be introduced to PMD project after fixing an issue , and new rules can work as expected.".freeze
|
16
16
|
s.email = ["andreas.dangel@pmd-code.org".freeze, "djydewang@gmail.com".freeze, "clement.fournier76@gmail.com".freeze]
|
17
17
|
s.executables = ["pmdtester".freeze]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* Simple module to fetch code snippets via ajax.
|
3
3
|
* Only supports github hosted code repos.
|
4
|
-
*
|
4
|
+
*
|
5
5
|
* Usage:
|
6
6
|
* var el = document.createElement('p');
|
7
7
|
* var url = 'https://github.com/checkstyle/checkstyle/tree/checkstyle-8.0/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/InputVariableDeclarationUsageDistanceCheck.java'
|
@@ -11,20 +11,22 @@
|
|
11
11
|
*/
|
12
12
|
(function() {
|
13
13
|
const contextLines = 3;
|
14
|
+
const nbsp = "\u00a0";
|
14
15
|
|
16
|
+
// returns text, not html
|
15
17
|
function formatLineNumber(number) {
|
16
|
-
|
18
|
+
let prefix;
|
17
19
|
if (number < 10) {
|
18
|
-
prefix =
|
20
|
+
prefix = nbsp.repeat(3);
|
19
21
|
} else if (number < 100) {
|
20
|
-
prefix =
|
22
|
+
prefix = nbsp.repeat(2);
|
21
23
|
} else if (number < 1000) {
|
22
|
-
prefix =
|
24
|
+
prefix = nbsp;
|
23
25
|
}
|
24
26
|
return prefix + number;
|
25
27
|
}
|
26
28
|
|
27
|
-
function fetchSnippet(
|
29
|
+
function fetchSnippet(document, container, url, line, weburl) {
|
28
30
|
var weburl, requestUrl, oReq;
|
29
31
|
|
30
32
|
requestUrl = url.replace(/github.com/, "raw.githubusercontent.com");
|
@@ -32,32 +34,37 @@
|
|
32
34
|
|
33
35
|
oReq = new XMLHttpRequest();
|
34
36
|
oReq.addEventListener("load", function() {
|
35
|
-
|
37
|
+
let lines, start, deleteCount;
|
38
|
+
|
39
|
+
// we'll append stuff in the loop below
|
40
|
+
container.innerHTML = '<p><a href="' + weburl + '" target="_blank" rel="noopener noreferrer">' + weburl + '</a></p>';
|
36
41
|
|
37
|
-
html = '<p><a href="' + weburl + '" target="_blank" rel="noopener noreferrer">' + weburl + '</a></p>';
|
38
42
|
lines = this.responseText.split(/\r\n|\n/);
|
39
43
|
start = line - contextLines;
|
40
44
|
if (start > 0) {
|
41
|
-
lines.splice(0, start);
|
45
|
+
lines.splice(0, start); // remove lines before
|
42
46
|
}
|
43
47
|
deleteCount = lines.length - (2 * contextLines) + 1;
|
44
|
-
lines.splice(2 * contextLines - 1, deleteCount);
|
45
|
-
|
46
|
-
lines
|
48
|
+
lines.splice(2 * contextLines - 1, deleteCount); // delete lines after
|
49
|
+
|
50
|
+
// now we have just the lines which will be displayed
|
51
|
+
lines.forEach(line => {
|
47
52
|
start++;
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
html += "<code>";
|
53
|
+
let lineElt = document.createElement("code");
|
54
|
+
if (start === line) {
|
55
|
+
lineElt.classList.add("highlight");
|
52
56
|
}
|
53
|
-
|
57
|
+
// createTextNode escapes special chars
|
58
|
+
lineElt.appendChild(document.createTextNode(formatLineNumber(start) + nbsp + line));
|
59
|
+
lineElt.appendChild(document.createElement("br"));
|
60
|
+
|
61
|
+
container.appendChild(lineElt); // append to the container
|
54
62
|
});
|
55
|
-
el.innerHTML = html;
|
56
63
|
});
|
57
64
|
oReq.open("GET", requestUrl);
|
58
65
|
oReq.send();
|
59
66
|
|
60
|
-
|
67
|
+
container.innerHTML = "<samp>fetching...</samp>";
|
61
68
|
}
|
62
69
|
|
63
70
|
window.pmd_code_snippets = {
|
@@ -23,7 +23,7 @@ $(document).ready(function () {
|
|
23
23
|
function renderCodeSnippet(violation) {
|
24
24
|
var node = document.createElement('p');
|
25
25
|
var url = project.source_link_base + '/' + project.file_index[violation.f];
|
26
|
-
window.pmd_code_snippets.fetch(node, url, violation.l, makeCodeLink(violation));
|
26
|
+
window.pmd_code_snippets.fetch(document, node, url, violation.l, makeCodeLink(violation));
|
27
27
|
return node;
|
28
28
|
}
|
29
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pmdtester
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Dangel
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-04-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -313,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
313
313
|
- !ruby/object:Gem::Version
|
314
314
|
version: '0'
|
315
315
|
requirements: []
|
316
|
-
rubygems_version: 3.1.
|
316
|
+
rubygems_version: 3.1.6
|
317
317
|
signing_key:
|
318
318
|
specification_version: 4
|
319
319
|
summary: A regression testing tool ensure that new problems and unexpected behaviors
|