Skip to content

Commit

Permalink
Implement mismatched indentation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed Jul 22, 2024
1 parent 3d46f43 commit 5d5bf92
Show file tree
Hide file tree
Showing 5 changed files with 391 additions and 105 deletions.
3 changes: 2 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,11 @@ warnings:
- DUPLICATED_WHEN_CLAUSE
- FLOAT_OUT_OF_RANGE
- IGNORED_FROZEN_STRING_LITERAL
- INDENTATION_MISMATCH
- INTEGER_IN_FLIP_FLOP
- INVALID_CHARACTER
- INVALID_MAGIC_COMMENT_VALUE
- INVALID_NUMBERED_REFERENCE
- INVALID_SHAREABLE_CONSTANT_VALUE
- KEYWORD_EOL
- LITERAL_IN_CONDITION_DEFAULT
- LITERAL_IN_CONDITION_VERBOSE
Expand Down
6 changes: 6 additions & 0 deletions include/prism/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,12 @@ struct pm_parser {
* characters.
*/
bool current_regular_expression_ascii_only;

/**
* By default, Ruby always warns about mismatched indentation. This can be
* toggled with a magic comment.
*/
bool warn_mismatched_indentation;
};

#endif
Loading

0 comments on commit 5d5bf92

Please sign in to comment.