Skip to content

Commit 5d5bf92

Browse files
committed
Implement mismatched indentation warning
1 parent 3d46f43 commit 5d5bf92

File tree

5 files changed

+391
-105
lines changed

5 files changed

+391
-105
lines changed

config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,11 @@ warnings:
298298
- DUPLICATED_WHEN_CLAUSE
299299
- FLOAT_OUT_OF_RANGE
300300
- IGNORED_FROZEN_STRING_LITERAL
301+
- INDENTATION_MISMATCH
301302
- INTEGER_IN_FLIP_FLOP
302303
- INVALID_CHARACTER
304+
- INVALID_MAGIC_COMMENT_VALUE
303305
- INVALID_NUMBERED_REFERENCE
304-
- INVALID_SHAREABLE_CONSTANT_VALUE
305306
- KEYWORD_EOL
306307
- LITERAL_IN_CONDITION_DEFAULT
307308
- LITERAL_IN_CONDITION_VERBOSE

include/prism/parser.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,12 @@ struct pm_parser {
902902
* characters.
903903
*/
904904
bool current_regular_expression_ascii_only;
905+
906+
/**
907+
* By default, Ruby always warns about mismatched indentation. This can be
908+
* toggled with a magic comment.
909+
*/
910+
bool warn_mismatched_indentation;
905911
};
906912

907913
#endif

0 commit comments

Comments
 (0)