-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build task experimental rules (#1307)
* Add separate verification build step to include experimental rules Ktlint should apply the dogfooding principal and only provide experimental rules that at least on the ktlint code base itself gives satisfiable results. Initially all experimental rules that cause violations have been disabled, so that a separate commit can be created to enable each specific rule. * Enable rule experimental:spacing-between-declarations-with-comments For BaselineTests it was necessary to rename the files which are used for testing to have a non standard kotlin file extension. This prevents the files from being changed when running the ktlint formatting on the ktlint code base itself. Note that the baseline protection mechanism did work in this case and as of that has been removed from the command. * Enable rule experimental:no-empty-first-line-in-method-block * Enable rule experimental:annotation * Resolve some violations of rule experimental:argument-list-wrapping It is not yet possible to enable the rule as some violations are actually false positives. This will be solved by #1284 * Enable rule experimental:spacing-between-declarations-with-annotations * Enable rule experimental:trailing-comma For now, it has been chosen to disallow trailing comma's instead of forcing them to be added. Reasons for this are two folded. The number of changes is considerably smaller. More importantly is that the benefit, with respect to avoiding future merge conflicts, seems not that big when scanning the code change which would result from forcing the trailing comma to be added. * Update changelog * Remove autocorrect mode from build step ktlint_experimental * Run the experimental rules by default There is no need for a separate build task to run the experimental rules. The experimental rules can be executed by default in the "ktlint" task. Also, the baseline has been fixed so there is no longer a need to use extension "_kt" for the baseline test files. Closes #1222 * Update ktlint/src/test/resources/TestBaselineFile.kt * Update ktlint/src/test/resources/TestBaselineFile.kt * Update ktlint/src/test/resources/TestBaselineExtraErrorFile.kt * Update ktlint/src/test/resources/TestBaselineExtraErrorFile.kt * Revert BaselineTests * Revert ktlint-test-baseline * Fix tests * Exclude all test resources from the ktlint module from the linting task Those source files all contain linting errors which have to be reported by unit tests. Therefore they should not be reported during a normal build because those should not be fixed as that would result in the tests to fail. * Revert renaming of file test-baseline.xml * Fix lint errors due to merge of master in branch Co-authored-by: Paul Dingemans <pdingemans@bol.com> Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
- Loading branch information
1 parent
e5206c3
commit 77c60e5
Showing
26 changed files
with
101 additions
and
106 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.