-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show info that empty constraint lists can be removed (#572)
Closes #570 ### Summary of Changes Show an info if a constraint list is empty. --------- Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
- Loading branch information
1 parent
cba3abf
commit af13e28
Showing
6 changed files
with
70 additions
and
38 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
9 changes: 9 additions & 0 deletions
9
tests/resources/validation/style/unnecessary constraint list in annotation/main.sdstest
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package tests.validation.style.unnecessaryConstraintListInAnnotation | ||
|
||
// $TEST$ info "This constraint list can be removed." | ||
annotation MyAnnotation1 »where {}« | ||
|
||
// $TEST$ no info "This constraint list can be removed." | ||
annotation MyAnnotation2 »where { | ||
T sub Int | ||
}« |
9 changes: 9 additions & 0 deletions
9
tests/resources/validation/style/unnecessary constraint list in class/main.sdstest
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package tests.validation.style.unnecessaryConstraintListInClass | ||
|
||
// $TEST$ info "This constraint list can be removed." | ||
class MyClass1 »where {}« | ||
|
||
// $TEST$ no info "This constraint list can be removed." | ||
class MyClass2<T> »where { | ||
T sub Int | ||
}« |
11 changes: 11 additions & 0 deletions
11
tests/resources/validation/style/unnecessary constraint list in enum variant/main.sdstest
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package tests.validation.style.unnecessaryConstraintInEnumVariant | ||
|
||
enum MyEnum { | ||
// $TEST$ info "This constraint list can be removed." | ||
MyVariant1 »where {}« | ||
|
||
// $TEST$ no info "This constraint list can be removed." | ||
MyVariant2<T>() »where { | ||
T sub Int | ||
}« | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/resources/validation/style/unnecessary constraint list in function/main.sdstest
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package tests.validation.style.unnecessaryConstraintListInFunction | ||
|
||
// $TEST$ info "This constraint list can be removed." | ||
fun myFunction1() »where {}« | ||
|
||
// $TEST$ no info "This constraint list can be removed." | ||
fun myFunction2<T>() »where { | ||
T sub Int | ||
}« |