Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper loading of 3rd party rulesets and reporters. #577

Merged
merged 1 commit into from
Sep 16, 2019

Conversation

Tapchicoma
Copy link
Collaborator

@Tapchicoma Tapchicoma commented Sep 7, 2019

Unblocks using them on on java 9+.

Base on ideas discussed in #495 and #573 PRs.

To test - execute following steps:

$ ./gradlew :ktlint-ruleset-template:jar
...
$ ./gradlew sJE
...
$ docker run --rm -ti -w "/command" -v `pwd`:/command openjdk:11-jdk-slim ./ktlint/build/run/ktlint --debug --experimental --ruleset=ktlint-ruleset-template/build/libs/ktlint-ruleset-template.jar
[DEBUG] Discovered ruleset with "standard" id.
[DEBUG] Discovered ruleset with "custom" id.
[DEBUG] Discovered ruleset with "experimental" id.
[DEBUG] Discovered reporter with "checkstyle" id.
[DEBUG] Discovered reporter with "json" id.
[DEBUG] Discovered reporter with "plain" id.
[DEBUG] Initializing "plain" reporter with {verbose=false, color=false}
[DEBUG] Checking /command/ktlint/src/main/kotlin/com/pinterest/ktlint/Main.kt
...

You should see that ruleset with "custom" id is discovered and lint failed with a lot of errors "Unexpected var, use val instead (cannot be auto-corrected)".

Closes #259.

Unblocks using them on on java 9+.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
@shashachu shashachu merged commit dd3a584 into pinterest:master Sep 16, 2019
@shashachu
Copy link
Contributor

thank you!

@Tapchicoma Tapchicoma deleted the support-java-9 branch September 16, 2019 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--reporter/--ruleset Java 9+ compatibility
2 participants