-
Notifications
You must be signed in to change notification settings - Fork 503
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
Wrapping rule should not prevent comments for interfaces on separate lines #1457
Conversation
Tnx for your contribution. Most important remark is that the test case which is added also succeeds without changing the WrappingRule. |
ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/WrappingRule.kt
Outdated
Show resolved
Hide resolved
...t-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/WrappingRuleTest.kt
Outdated
Show resolved
Hide resolved
...t-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/WrappingRuleTest.kt
Show resolved
Hide resolved
...t-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/WrappingRuleTest.kt
Outdated
Show resolved
Hide resolved
ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/WrappingRule.kt
Outdated
Show resolved
Hide resolved
@paul-dingemans I've fixed your PR comments re: testing and single line. |
@paul-dingemans thanks, should I update the changelog or is anything else needed? |
|
Closes #1457
With KtLintAssertThat an AssertJ style `assertThat` is created for a specific rule. In addition to that rule, it is possible to run additional rules. In case the rule which is to be tested has defined a VisitorModifier which requires one or more additional rules to be loaded and to be enabled, it is mandatory that those rules are added to the unit test. The goal is to execute the rules during unit tests in the same order as when running the CLI version of KtLint. During each unit test a dynamic RuleSet is being created for a limited set of rules (e.g. the rule for which the `assertThat` is created plus the additional rules specified in the unit tests). The rules in this minimized ruleSet are executed in the order as defined by the VisitorModifier as defined in the rules. In order to achieve above, following is changed as well: * Split naming policy of rule id and rule set id. The naming policy of the latter is not changed. The naming policy of the ruleId is changed so that the ruleSetId prefix can be specified optionally. If the ruleId is not prefixed with a ruleSetId then it is assumed to be equal to "standard". For all experimental rules, the ruleSetId has been added. * Remove obsolete parameter "isUnitTestContext" from VisitorProvider * As the VisitorModifiers are now also used and checked during unit tests, it is required to run the additional rules during the lint phase as well. Some code examples in tests in which the IndentationRule is added as additional rule are changed to comply with that rule. Closes pinterest#1457
Description
Currently, comments on interfaces will report an error. This behavior is different than i.e. legal commenting on function parameters.
If the PR solves an issue than provide a link to that issue. -->
Checklist
CHANGELOG.md
is updatedIn case of adding a new rule:
README.md
is updated