-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AnnotationRule: disallow empty line between annotation and annotated …
…target (#755) * Create the test to ensure that stable indentation passes the requirement that the annotation is not separated from the object it is annotating * Creating the test for the annotation that we want to make sure fails. Eg, this test should result in a failure since the @JvmField annotation is separated from the function by a blank line * First pass at creating the rules for checking the line break - logic based on above rules for ensuring that we have a stable break with the list of annotations. Next step is to run unit test to make sure this triggers a failure * Updating test to reflect the correct placement of the annotation so that we can ensure we see a valid break in the tests. Next step is to create a test for the auto correction * Creating the test (red) that will fail currently, but ensure that we get a solid check for our issue once the autoformat is added to our code * Updated the rule to get it working so that all the inclusions make sure we have all the fields input correctly and we remove redundant line breaks * Adding extra tests and breaking our auto correction in testing multiple sources * Ensure we do not apply this rule to @filename * Ensure we fix the test so it satisfies all the issue we have seen so far * Fixing ktlint issues * Updating format on the kt files - strangely not being picked up earlier on ./gradlew :ktlint * Adding additional test cases: @JvmField @JvmStatic fun foo() = Unit // and @JvmField @JvmStatic fun foo() = Unit * Adding the test in as well as the piece for spaces between annotations * Tweaking the measurements a bit so that we can handle all the edge cases * Lint fixes * Minor tweaks Co-authored-by: Roman Zavarnitsyn <[email protected]>
- Loading branch information
1 parent
42b555e
commit 4dda69b
Showing
2 changed files
with
351 additions
and
1 deletion.
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