Skip to content

Fix negative blank line indentation#1

Merged
ioquatix merged 3 commits into
mainfrom
fix-consistent-blank-line-negative-indent
Jul 18, 2026
Merged

Fix negative blank line indentation#1
ioquatix merged 3 commits into
mainfrom
fix-consistent-blank-line-negative-indent

Conversation

@ioquatix

@ioquatix ioquatix commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Preserve raw AST indentation deltas instead of clamping them in build_indentation_deltas.
  • Track semantic_level separately from visual current_level, so same-line nested opens only add one visual indentation level while later closes remain balanced.
  • Add a regression for a top-level blank line after same-line nested array/hash opens.

Testing

  • Direct ruby -Ilib regression for top-level blank line after same-line nested array/hash opens.
  • Direct ruby -Ilib check for existing same-line array/hash indentation case.
  • RUBYLIB=/Users/samuel/Developer/socketry/rubocop-socketry/lib bundle exec rubocop -d from async: no crash, reports one existing correctable offense in external/async-http/examples/race/client.rb:26.

Note: bundle exec sus test/rubocop/socketry/layout/consistent_blank_line_indentation.rb could not run because several locked gems are not installed locally.

@ioquatix
ioquatix merged commit 19ed917 into main Jul 18, 2026
42 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant