Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: ignored nodes in indent rule (fixes #9392)
When a node is ignored by the indent rule, it ought not to matter how it’s indented. But the ignoring of nodes was implemented in such a way that the *type* of indentation (tabs vs spaces) was being checked. For example in "tab" mode, an ignored line indented by four spaces would cause the error “Expected indentation of 4 tabs but found 4 spaces”. In particular, this is a problem with “tabs for indentation, spaces for alignment” styles, where we want to allow code like: var x = 1, y = 2; where the second line is aligned using four spaces. This commit marks ignored indents by making them instances of the IgnoredTokenIndent class, and explicitly ignoring the indentation of such lines. All tests pass. Fixes #9392.
- Loading branch information
1 parent
ee99876
commit 90ae854
Showing
2 changed files
with
46 additions
and
3 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