feat(#1271): run Java lints from YAML packs via lint key - #1277
Open
VasilevNStas wants to merge 4 commits into
Open
feat(#1271): run Java lints from YAML packs via lint key#1277VasilevNStas wants to merge 4 commits into
VasilevNStas wants to merge 4 commits into
Conversation
…er lint packs in EO test
Contributor
Author
|
@yegor256 @volodya-lombrozo plz review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #1271
What
Adds support for running Java-implemented lints from the same YAML pack
format that XSL lints use, instead of requiring a bespoke
Lt*Test.javaclass per lint.
A pack can now reference a lint by name:
How
XtLint(aXtory): reads thelint:key from the pack YAML,resolves the lint via
PkMono, runsdefects(XML)and serializes theresult into the
<defects>document. It plugs into the existingXsline/XtoryMatcher/DefectsMatchermachinery by returning aShiftthat produces the defects, soXtDefects(thedefects: Nshorthand) and all existing assertions work unchanged.
LtByXslTest:testsAllLintsByLintNameparameterized test runs packs with alint:key;testsAllLintsByEoandchecksLocationsOfYamlPacksskip such packs(they have no
sheets/XSL counterpart).Demo packs
The following Java lints are now covered declaratively:
ascii-only—catches-cyrillic-commentreserved-name—allows-custom-nameincorrect-unlint—catches-unknown-lintsyntax-version—catches-newer-syntax,allows-older-syntaxThis is the pattern @volodya-lombrozo proposed for
LtSyntaxVersionandfriends, so future Java lints (and the existing ones) can drop their
hand-written JUnit boilerplate.
Both
mvn test(1011 tests) andmvn clean install -Pqulicepass.