Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move wrapping logic from IndentationRule to new WrappingRule
Wrapping logic belong in an own rule, so it can be disabled without disabling the indentation logic. The WrappingRule contains a simplified indentation logic. Whenever a linebreak is inserted, it determines the indentation based on the current indentation of the parent node regardless whether this node is indented correctly. It is the responsibility of the IndentationRule, which runs later than the WrappingRule to fix the indentations. Spec files used in the unit tests have been split. Some parts are moved to new spec files specific for the WrappingRule. Other parts are moved to real unit tests. And on some spec files, both the wrapping and indentation rules are run together. Those files need further refactoring. The RuleExtension now also allows the diffFileLint and diffFileFormat to run on a list of rules. Spec files which are used for linting with multiple rules must specify the rule-id in the expectations. The rule-id now optionally can also be specified in those expectation when the file is checked by only one rule. However, in case the detail property of the LintError contains a ":" then the rule-id *must* be specified as it is used as delimiter. Closes pinterest#835
- Loading branch information