Skip to content

Conversation

@beauraF
Copy link

@beauraF beauraF commented Nov 17, 2025

We noticed a formatting difference for regex between rubocop and syntax_tree, which causes back-and-forth changes between the two tools.

For example, this is what the code looks like when formatted by rubocop:

let(:gotcha_with_check_deleted_lines) do
  {
    text: 'Couchbase model gotcha',
    file_regexp: %r{^app/models/.*\.rb},
    keywords: [/ attribute :/],
    check_deleted_lines: true,
  }

And this is what it looks like when formatted by syntax_tree:

let(:gotcha_with_check_deleted_lines) do
 {
   text: 'Couchbase model gotcha',
   file_regexp: %r{^app/models/.*\.rb},
   keywords: [%r{ attribute :}],
   check_deleted_lines: true,
 }

Therefore, I propose disabling Style/RegexpLiteral in config/rubocop.yml and letting syntax_tree handle regex formatting.

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