Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #9606. This PR fixes the following error for `Layout/IndentationConsistency` when using access modifier at the top level. ```console % cat example.rb public def foo end % bundle exec rubocop --only Layout/IndentationConsistency example.rb -d (snip) Scanning /Users/koic/src/github.com/koic/rubocop-issues/9606/example.rb An error occurred while Layout/IndentationConsistency cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/9606/example.rb:1:0. undefined method `source_range' for nil:NilClass /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/layout/indentation_consistency.rb:165:in `base_column_for_normal_style' /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/layout/indentation_consistency.rb:181:in `check_normal_style' /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/layout/indentation_consistency.rb:174:in `check' /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/layout/indentation_consistency.rb:129:in `on_begin' ```
- Loading branch information