Code Monkey home page Code Monkey logo

contribution's Introduction

Checkstyle contribution

This repository is a support repository some tools that are used in checkstyle development and other contributions that are valuable but should not be in main checkstyle repo

All files/code/.... are licensed under the terms in the file named "LICENSE" in this directory.

contribution's People

Contributors

abhishek-kumar09 avatar akmo3 avatar attatrol avatar baratali avatar daniilyar avatar dependabot[bot] avatar friederbluemle avatar github-actions[bot] avatar josephmate avatar jsoref avatar kevin222004 avatar liscju avatar lmh-java avatar manish-k-07 avatar mezk avatar mkordas avatar nrmancuso avatar pbludov avatar rahulkhinchi03 avatar rdiachenko avatar rnveach avatar romani avatar stoyank7 avatar strkkk avatar timurt avatar vampire avatar vladlis avatar vyom-yadav avatar wltan avatar zopsss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contribution's Issues

Refactoring of diff.groovy

  1. generateDiffReport and generateCheckstyleReport now receive too many parameters. Parameters should be represented as an objects of the specific class or the methods need to be refactored so as not to have so many parameters.

[checkstyle-tester] ArrayOutOfBoundsException in launch.groovy when commit id is not set

There are lines in projects-for-circle.properties where commit tag or SHA-1 is not set. It leads to ArrayOutOfBoundsException in launch.groovy.

Testing Checkstyle started
Caught: java.lang.ArrayIndexOutOfBoundsException: 3
java.lang.ArrayIndexOutOfBoundsException: 3
	at launch$_generateCheckstyleReport_closure1.doCall(launch.groovy:69)
	at launch.generateCheckstyleReport(launch.groovy:62)
	at launch$generateCheckstyleReport$0.callCurrent(Unknown Source)
	at launch.run(launch.groovy:10)

@romani
How should the script know whether the 4th element (starting from 0) in the line is commit id or there is an exclude section? I propose to have all elements in line specified: REPO_NAME|REPO_TYPE|REPO_URL|COMMIT_ID|EXCLUDES or we can follow the rule: if line contains 4 elements than the 4th element is commit id. If line contains 5 elements than 4th is commit id and 5th is excludes.

diff.groovy fails with IllegalStateException for git version 2.10.1 (Apple Git-78)

diff.groovy looks for the text 'nothing to commit, working directory clean'. This fails for my version of git.

SMKDev:checkstyle shawn.kovalchick$ git --version
git version 2.10.1 (Apple Git-78)
SMKDev:checkstyle shawn.kovalchick$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

diff.groovy should skip tests on patch-diff-report-tool

With the soon-to-be introduction of more tests for patch-diff-report-tool in #176 , diff.groovy's use of patch-diff-report-tool will run the tests unnecessarily each time diff.groovy is run.

The packaging of patch-diff-report-tool should skip any and all tests by default in diff.groovy.

[patch-diff-report-tool] Build failure due to NewLineAtEndOfFile check.

When build patch-diff-report-tool using mvn install:

[INFO] --- maven-checkstyle-plugin:2.17:check (check) @ patch-diff-report-tool ---
[INFO] There are 26 errors reported by Checkstyle 6.15 with https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-6.15/config/checkstyle_checks.xml ruleset.
[ERROR] src\main\java\com\github\checkstyle\data\CheckstyleRecord.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\data\CliPaths.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\data\DiffReport.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\data\DiffReport.java:[22] (imports) AvoidStaticImport: Using a static member import should be avoided - com.github.checkstyle.parser.StaxContentParser.DIFF_REPORT_INDEX.
[ERROR] src\main\java\com\github\checkstyle\data\MergedConfigurationModule.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\data\package-info.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\data\Statistics.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\data\Statistics.java:[22] (imports) AvoidStaticImport: Using a static member import should be avoided - com.github.checkstyle.parser.StaxContentParser.BASE_REPORT_INDEX.
[ERROR] src\main\java\com\github\checkstyle\data\Statistics.java:[23] (imports) AvoidStaticImport: Using a static member import should be avoided - com.github.checkstyle.parser.StaxContentParser.PATCH_REPORT_INDEX.
[ERROR] src\main\java\com\github\checkstyle\FilesystemUtils.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\Main.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\package-info.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\parser\ConfigurationMerger.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\parser\ConfigurationModule.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\parser\package-info.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\parser\StaxConfigurationParser.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\parser\StaxContentParser.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\parser\StaxUtils.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\PreparationUtils.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\site\AnchorCounter.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\site\JxrDummyLog.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\site\package-info.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\site\SiteGenerator.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.
[ERROR] src\main\java\com\github\checkstyle\site\SiteGenerator.java:[22] (imports) AvoidStaticImport: Using a static member import should be avoided - com.github.checkstyle.PreparationUtils.XREF_FILEPATH.
[ERROR] src\main\java\com\github\checkstyle\site\SiteGenerator.java:[118,29] (coding) MultipleStringLiterals: The String "config" appears 2 times in the file.
[ERROR] src\main\java\com\github\checkstyle\site\XrefGenerator.java:[0] (misc) NewlineAtEndOfFile: File does not end with a newline.

patch-diff-report-tool throws NullPointerException

When i run patch-diff-report-tool i get:

liscju@liscju-host:~/Checkstyle/contribution/patch-diff-report-tool/target$ java -jar patch-diff-report-tool-0.1-SNAPSHOT-jar-with-dependencies.jar ~/Checkstyle/liscju.github.io/issue2838v2/before/target/ ~/Checkstyle/liscju.github.io/issue2838v2/after/target/ ~/Checkstyle/contribution/checkstyle-tester/src/main/java/ ~/Checkstyle/liscju.github.io/issue2838v2/diff/
Successfull preparation stage.
Exception in thread "main" java.lang.NullPointerException
    at java.util.TreeMap.compare(TreeMap.java:1290)
    at java.util.TreeMap.put(TreeMap.java:538)
    at com.github.checkstyle.data.ParsedContent.addRecords(ParsedContent.java:75)
    at com.github.checkstyle.parser.StaxParserProcessor.parseXmlPortion(StaxParserProcessor.java:211)
    at com.github.checkstyle.parser.StaxParserProcessor.parse(StaxParserProcessor.java:134)
    at com.github.checkstyle.Main.executeStages(Main.java:273)
    at com.github.checkstyle.Main.main(Main.java:237)

My version of maven: 3.0.5, java: 1.8.0_45, reports which leads to error i put in https://github.com/liscju/patch-diff-report-tool-npe

launch.groovy never updates existing projects

def cloneRepository(repoName, repoType, repoUrl, commitId, srcDir) {
def srcDestinationDir = "$srcDir/$repoName"
if (!Files.exists(Paths.get(srcDestinationDir))) {
def cloneCmd = getCloneCmd(repoType, repoUrl, srcDestinationDir)
println "Cloning $repoType repository '$repoName' to $srcDestinationDir folder ..."
executeCmd(cloneCmd)
println "Cloning $repoType repository '$repoName' - completed\n"
}

When we run the program once, we clone the repositories and get the latest data.
When we run the program future times, we never do a fetch. Long time users who constantly use this tool will never be running on the latest projects and they will never update these repositories by hand.

I feel we should force users to use the latest code for the project if a specific commit is not specified.
We might want to consider doing resets/cleans in case we change from a specific commit to no commit, or if the user plays around with the repository for some reason, to verify the project is in the state we wish to test.

It was mentioned part of the reason this was not done was so the tool could be used in an offline mode and doing a fetch will break this. We can get around this by either 1) ignoring a failed fetch or 2) adding a new option -dontFetchUpdates (or some other name).

patch-diff-report-tool: all report numbers should have unique ids

All numbers/counts generated in patch-diff-report-tool should have unique IDs on them so scripts can parse them out and use their data on their summary page if they want to.

Severity counts currently don't have an ID and this is why launch_diff.sh only printed totalDiff.

External utilities can decide to make use of these IDs or not. An example would be to always show red error next to project name on summary if high severity occurred, like exceptions, so that they don't go missed.

Purpose of summary page is give user a glance to find projects with the most interesting results (violations, exceptions, etc)

Create travis test launches for groovy tester

Like title suggests. We request users use this program for work in checkstyle. We should create some type of test(s) to verify it is functioning correctly during updates to its functionality.

after checkstyle 7.4 remove suppresson

as checkstyle 7.4 is released - apply patch:

diff --git a/releasenotes-builder/src/main/java/com/github/checkstyle/Main.java b/releasenotes-builder/src/main/java/com/github/checkstyle/Main.java
index 85e4be1..0981afc 100644
--- a/releasenotes-builder/src/main/java/com/github/checkstyle/Main.java
+++ b/releasenotes-builder/src/main/java/com/github/checkstyle/Main.java
@@ -30,7 +30,6 @@ import org.kohsuke.github.GHRepository;
 import org.kohsuke.github.GitHub;
 
 import com.github.checkstyle.publishers.MailingListPublisher;
-// -@cs[CustomImportOrder] Until https://github.com/checkstyle/checkstyle/issues/3590
 import com.github.checkstyle.publishers.SourceforgeRssPublisher;
 import com.github.checkstyle.publishers.TwitterPublisher;
 import com.github.checkstyle.publishers.XdocPublisher;

Ignore excludes in diff reports only

Based on Issue #154, I question why we need excludes in diff reports.
I am not talking about no-exception testing. I am ONLY talking about any script that uses patch-diff-report-tool.

We already turn exceptions into violations and treat them the same in reports. If they stay the same we ignore them, if they change we report them as a difference.
Referenced issue had a problem with excludes and should be fixed, but why do we care about excludes? Main reason for excludes is to skip files that aren't parsable as they produce exceptions. But like I said above, exceptions aren't an issue in these regressions. We also want to know any difference in these exceptions, like if we fix grammar parsing. Excludes would have to change for that if it does happen.

So are we losing anything by ignoring excludes in diff reports? I don't think so. Only negative side-effect may be more files to parse, which may not be a bad thing.

I propose we change launch_diff and diff.groovy to ignore the exclude column in the properties file. We should not change any properties files at all. We will just not read their values making it like they don't exist.
Since diff.groovy/launch.groovy are 2 separate programs, diff will need to send a new parameter to launch to turn off reading the excludes. Default behavior of launch.groovy should still read exclude column as it is needed for no-exception testing.

patch-diff-report-tool: report uniques differences

Current report total unique violations for base and patch, and how many total unique violations there are.
It would be nice if we also reported separately the number of new violations in patch and the number of removed violations in base. This is useful if I am expecting no old violations to change and should only see new violations.

Example:
http://rnveach.github.io/checkstyle/2763/Hbase/index.html

Report id   Files   Unique rows     Severity-warning
base    7683    14289   14289
patch   2561    15201   15201
difference  272     912     912

base Unique rows = unique violations for base = 14289
patch Unique rows = unique violations for patch = 15201
difference Unique rows = total unique violations = 912

Since this is a new part of the check, I am expecting all violations to be new, but its not easy to go through 912 manually, and very easy to miss one. Though I will still look at the majority of cases, the summary helps point out possible real issues that should be looked at.

What I am asking for is 2 new counts that would say for this report:

Old violations not showing: 0 (count of all orange/base unique rows in report)
New violations now showing: 912 (count of all green/patch unique rows in report)

Some excludes in tester are too broad

Some excludes are too broad in tester, and most likely caused issues in regression (checkstyle/checkstyle#3737 (review)) where good files for processing were incorrectly being ignored.

Example:

#guava-mvnstyle|git|http://github.com/google/guava|master|**/**/test/**/*,**/guava-gwt/src-super/**/*,**/guava-tests/**/*,**/guava-gwt/test-super/**/*

**/**/test/**/*

Some regression scripts put all projects into one directory, so this line is going to affect all of them incorrectly. Excludes should only affect their own project, no matter where it is stored or stored with.

We should review all excludes and verify they aren't too broad.
IMO, each one should mention the project name somehow.

patch-diff-report-tool: some xref paths are too long for windows

Example: M:\checkstyleWorkspace\gh_pages\3103\checkstyle\xref\home\ricky\opensource\contribution\checkstyle-tester\saverefs\checkstyle\checkstyle-checkstyle-f9ce38f\src\it\resources\com\google\checkstyle\test\chapter4formatting\rule42blockindentaion\InputIndentationCorrect.java.html
275 characters long.

The path is the fully qualified path of where the file existed when the tool was run.
For this tool, we only really care about the contents of the file and the contents of the main report. We can still display the fully qualified path on the main report, but is there any reason the java.html file has to have this long a path?

It would be nice if we shortened the path to just "\xref\some_name.java.html". Unless there is a reason we need the same file name as the original, it could be like "File1", "File2", etc.

releasenotes-builder: missed new feature

issue checkstyle/checkstyle#3437
one more : checkstyle/checkstyle#3892

has label "new feature" but it is not present in releasenotes after 7.6, that forced me to create 7.6.1 release instead of 7.7 .

Release notes skip information for update for all our plugins. That might result in wave of problems.

TODO: investigate a reason of missed "new feature" group in release notes of 7.6.1 - checkstyle.sourceforge.net/releasenotes.html#Release_7.6.1

link to all closed "new feature" issues - https://github.com/checkstyle/checkstyle/issues?q=is%3Aissue+label%3A%22new+feature%22+is%3Aclosed+sort%3Aupdated-desc

Default tester config should not be accepted as a good configuration

Taken from checkstyle/checkstyle#4060 (comment) and checkstyle/checkstyle#3967 (comment) and checkstyle/checkstyle#3928 (comment) and checkstyle/checkstyle#3887 (comment) and so on ....,

https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/my_check.xml#L26
Users run regression and report no differences but it turns out their reports are false because they didn't change the configuration file for their checks.

Tester shouldn't accept this configuration file. Either we should change it to have an invalid module name, or no default module and examine contents somehow to determine if user specified module or not.
If module isn't added/changed, we should result in an error so it is clear to novice users.

Strange problem with file that exists in report and missed on filesystem

for some reason after siet generation fllowgin files are missed even referenced in report

<th>Severity</th>
<th>Category</th>
<th>Rule</th>
<th>Message</th>
<th>Line</th></tr>
<tr class="a">
<td><img src="images/icon_warning_sml.gif" alt="" />&#160;Warning</td>
<td>whitespace</td>
<td>EmptyLineSeparator</td>
<td>'package' should be separated from previous statement.</td>
<td><a href="./xref/guava/guava/src/com/google/common/base/package-info.html#L65">65</a></td></tr></table></div>

After update:

warning: ./guava/guava/src/com/google/common/base/package-info.html not found.
warning: ./guava/guava/src/com/google/common/cache/package-info.html not found.
warning: ./guava/guava/src/com/google/common/escape/package-info.html not found.
warning: ./guava/guava/src/com/google/common/eventbus/package-info.html not found.
warning: ./guava/guava/src/com/google/common/graph/package-info.html not found.
warning: ./guava/guava/src/com/google/common/hash/package-info.html not found.
warning: ./guava/guava/src/com/google/common/html/package-info.html not found.
warning: ./guava/guava/src/com/google/common/io/package-info.html not found.
warning: ./guava/guava/src/com/google/common/math/package-info.html not found.
warning: ./guava/guava/src/com/google/common/net/package-info.html not found.
warning: ./guava/guava/src/com/google/common/primitives/package-info.html not found.
warning: ./guava/guava/src/com/google/common/util/concurrent/package-info.html not found.
warning: ./guava/guava/src/com/google/common/xml/package-info.html not found.
Removing all non used html files

patch-diff-report-tool: make ability to show lines as yellow if changes is only in message

taken from checkstyle/checkstyle#3774

Example:

Summary:
Report id 	Files 	Unique rows 	Severity-warning
base 	890 	1558 	1558
patch 	890 	35 	35
difference 	272 	1583 	1583

in this PR I expected no new violation, only changes.
But report forced me to review all 35 or 1558 items. What if I missed smth during scroll ?

Tool generate green and red only for initial simplicity with original author as first version.
Looks like it is time to do a bit more smart analysis of compare.
it will be very good to have "yellow" color that show what is changed. There a bunch of compare algorithms online to make this magic.

# 	warning 	LocalVariableName 	Local variable name 'dS' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'. 	1444 	27
# 	warning 	LocalVariableName 	Local variable name 'dS' must match pattern '^[a-z]([a-z0-9][a-zA-Z0-9]*)?$'. 	1444 	27

should be one line in report. Diff could be shown by any means. Ideal is (italic should strikedout):

Local variable name 'dS' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$^[a-z]([a-z0-9][a-zA-Z0-9]*)?$'

but simple combination of two messages in one cell will work more than enough!

mistake in startRef cause exception and success

mistake in startRef, cause exception and success.

~/java/git-others/checkstyle/contribution/releasenotes-xdoc-builder/target [master|● 3✖ 1] $ java -jar releasenotes-xdoc-builder-1.0-all.jar -localRepoPath /home/rivanov/java/git-others/checkstyle/checkstyle -startRef 7.0 -releaseNumber 7.1

Generation succeed!
Exception in thread "main" java.lang.NullPointerException
    at org.eclipse.jgit.lib.ObjectIdOwnerMap.get(ObjectIdOwnerMap.java:131)
    at org.eclipse.jgit.revwalk.RevWalk.lookupCommit(RevWalk.java:676)
    at org.eclipse.jgit.api.LogCommand.add(LogCommand.java:333)
    at org.eclipse.jgit.api.LogCommand.not(LogCommand.java:217)
    at org.eclipse.jgit.api.LogCommand.addRange(LogCommand.java:246)
    at com.github.checkstyle.NotesBuilder.getCommitsBetweenReferences(NotesBuilder.java:151)
    at com.github.checkstyle.NotesBuilder.buildResult(NotesBuilder.java:84)
    at com.github.checkstyle.Main.runNotesBuilder(Main.java:136)
    at com.github.checkstyle.Main.main(Main.java:88)

releasenotes-builder: misplaced space

from 7.7 releasenotes:

          <li>
            google_checks: update to most recent version of style guide (3 November 2016). Author: Andrei Selkin<a href="https://github.com/checkstyle/checkstyle/issues/3755"> #3755</a>
          </li>

space should not be before "#" it should be after author name

Enforce metioning issue in PR description to create links

moved from checkstyle/checkstyle#2929

Right now GitHub does not create link between issue and PR, when issue is referenced just from PR title, and it is not easy to quickly see from issue all pull requests where issue was implemented.

The solution for it, adopted in many projects, is to provide link to issue somewhere in PR description, for example:

#1 Short PR title

More detailed explanatory text.

Further paragraphs come after blank lines.

Resolves: #1
See also: #2, #3

Such approach, would guarantee great traceability in both directions between PR and issue. We can start enforcing it straight away by editing descriptions or asking authors to do that, but ideally it would be great to automate that.

My proposition is to create additional test that would basically do three tasks:

  • get issue number (let's say #1) from the latest commit (or just pass if there is no issue number)
  • read PR description through GitHub API or any other way - the simpler the better
  • make assertion that description contains at least one occurrence of #1

get issue number (let's say # 1) from the latest commit (or just pass if there is no issue number)

@mkordas If we are using travis and want to get fancy, maybe it's possible to use this variable to get all issue numbers in-case 1 PR has multiple issues in commits or 1 PR has non-issue commits with issue commits?

TRAVIS_COMMIT_RANGE: The range of commits that were included in the push or pull request.

Releasenotes generation result in checkstyle violations

@Vladlis , please take a look.

caused by : cf51b57

Notes from :
https://travis-ci.org/checkstyle/checkstyle/jobs/164101411#L273

result in:

     [echo] Checkstyle started: 30/09/2016 11:56:06 AM
[checkstyle] Running Checkstyle 7.1.2-SNAPSHOT on 904 files
[checkstyle] [ERROR] /home/rivanov/java/github/checkstyle/checkstyle/src/xdocs/releasenotes.xml:33: Line matches the illegal pattern '\s+$'. [RegexpSingleline]
[checkstyle] [ERROR] /home/rivanov/java/github/checkstyle/checkstyle/src/xdocs/releasenotes.xml:39: Line matches the illegal pattern '\s+$'. [RegexpSingleline]
[checkstyle] [ERROR] /home/rivanov/java/github/checkstyle/checkstyle/src/xdocs/releasenotes.xml:42: Line matches the illegal pattern '\s+$'. [RegexpSingleline]
[checkstyle] [ERROR] /home/rivanov/java/github/checkstyle/checkstyle/src/xdocs/releasenotes.xml:45: Line matches the illegal pattern '\s+$'. [RegexpSingleline]
[checkstyle] [ERROR] /home/rivanov/java/github/checkstyle/checkstyle/src/xdocs/releasenotes.xml:72: Line matches the illegal pattern '\s+$'. [RegexpSingleline]
     [echo] Checkstyle finished: 30/09/2016 11:56:30 AM

Expected: no errors on copy-paste operation from log to xdoc file

[releasenotes-builder] NPE on Travis CI

checkstyle Travis CI is red.

reverted: #130 now release notes is fine - https://travis-ci.org/checkstyle/checkstyle/jobs/179613449

Not relaunched build:
https://travis-ci.org/checkstyle/checkstyle/jobs/179594884

Exception in thread "main" java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:203)
	at java.util.Optional.<init>(Optional.java:96)
	at java.util.Optional.of(Optional.java:108)
	at com.github.checkstyle.NotesBuilder.getActualRefObjectId(NotesBuilder.java:226)
	at com.github.checkstyle.NotesBuilder.getCommitsBetweenReferences(NotesBuilder.java:152)
	at com.github.checkstyle.NotesBuilder.buildResult(NotesBuilder.java:84)
	at com.github.checkstyle.Main.runNotesBuilder(Main.java:147)
	at com.github.checkstyle.Main.main(Main.java:93)

diff.groovy tool should have options to specify base config and patch config

Sometimes we need to generate diff reports using different checkstyle configurations:

  1. base config
  2. patch config

For example, we change the option name and regexp for ParameterNameCheck. Now I have to change diff.groovy script and manually hardcode two configs in my local branch.

It would be good If diff.groovy had these two options (baseCheckstyleCfg, patchCheckstyleCfg). If patchCheckstyleCfg is not set, then diff.groovy will use baseCheckstyleCfg to generate Checkstyle report for both base and patch branches. In other words, baseCheckstyleCfg should be treated as required option, patchCheckstyleCfg should be optional.

Thus, what should be done:

  1. New options should be added.
  2. Documentation should be updated.

@romani @rnveach
Please, share your opinions.

Checkstyle XML Diff reports tool

Checkstyle and maven-checkstyle plugin could generate XML report.
Such report is very famous in web and a lot of other tools use it to show validation results.

checksstyle-tester project together with site(html report) generate XML report, located at:
checkstyle/contribution/checkstyle-tester/target/checkstyle-result.xml

wee need a some tool that could compare two xml files and make diff of them in some form.
the same or other tool grab this diff and convert it to HTML file in same format as ahsm tool did https://github.com/attatrol/ahsm (any better approach for format are welcome!).

Note: xref links should works and unique links to each report row !!! as it is critical

xref folder also need to be merged as chckstyle-tester cut them to keep only used files.

we need to keep link to config file to be a part of web site, to avoid extra questions.

Language could be any of JVMs: java, groovy ,scala

automate checkstyle-tester for diff report generation

checkstyle-tester should have a mode to completely automatically generate diff report base on:

  • latest binaries of chekcstyle (we could use our SNAPSHOT maven repo)
  • "link" to patch (or some other way defining new binaries)
  • config to run

result should be ready to upload to github.io folder with report.

invalid project commit in projects-to-test-on.properties

#apache-jsecurity|github|apache/jsecurity|89ffe41fddb62ad5f0349b17fb2a343d1f0dd152

apache-jsecurity|github|apache/jsecurity|89ffe41fddb62ad5f0349b17fb2a343d1f0dd152

Is converted to the URL: https://github.com/apache/jsecurity/tree/89ffe41fddb62ad5f0349b17fb2a343d1f0dd152

This points to a commit with no files in it. I noticed this during regression as AHSM complained about the missing XREF directory after a run on it.

Turn tester failsOnError into a property

<failsOnError>false</failsOnError>

This line needs to be turned into a property as a default value of false damages no exception testing.

In no exception testing, we want an exception to result in a build failure.
In a regression testing, we don't want an exception to result in a build failure, but be listed as a type of violation in the reports for differences.

groovy and launch_diff need to be changed to specify and set the property to false.
Default property in POM should be true.

Extra space in checkstyle-tester/projects-to-test-on.properties causes error.

Line 22 contains an extra space in the excludes section that causes maven to fail when this line is uncommented.

Running Checkstyle on src/main/java ... with excludes ,**/resources-noncompilable/**/*,,,**/test/tools/pack200/typeannos/TypeUseTarget.java,**/test/tools/pack200/typeannos/TypeUseTarget.java,**/test/java/awt/Focus/ModalDialogActivationTest/ModalDialogActivationTest.java,**/test/javax/xml/bind/jxc/8073519/**,**/test/sun/tools/jhsdb/**,,,**/pmd/pmd-java/src/test/**/*,**/lombok-ast/test/**/*,,**/hibernate-orm/documentation/**/*,, ,,,,**apache-ant/src/tests/**/*,apache-ant/src/etc/testcases/,,,**/resources/**/*,,,,,
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sample 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.082 s
[INFO] Finished at: 2017-01-20T12:28:49-05:00
[INFO] Final Memory: 7M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase ",,,,**apache-ant/src/tests/**/*,apache-ant/src/etc/testcases/,,,**/resources/**/*,,,,,". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
org.apache.maven.lifecycle.LifecyclePhaseNotFoundException: Unknown lifecycle phase ",,,,**apache-ant/src/tests/**/*,apache-ant/src/etc/testcases/,,,**/resources/**/*,,,,,". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy.
	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings(DefaultLifecycleExecutionPlanCalculator.java:246)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:217)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:127)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:145)
	at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:109)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

patch-diff-report-tool: allow patchReport by itself

patch-diff-report-tool only copies the needed files from the normal site command, trimming the amount of disk space the entire report needs. When running all projects, the before diff space used amounts to at least 1 gigabyte per branch for me.

However, for reports sometimes there is no base report, like when introducing a brand new Check.
It seems crazy to keep all those extra files and some utils are made to only read the patch-diff-report-tool's html report (launch_diff creates a main html report for multiple diff reports).

It would be nice if patch-diff-report-tool allowed just the patchReport and assumed the baseReport is completely empty for its compares.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.