Skip to content

interpolation-check

Rubysuspiciousno fixdefault: warnruby/rubocop

Reports a single-quoted string that holds #{...}.

Single quotes do not interpolate, so the text #{b} stays as it is. It is a typical slip when quotes are changed.

To fix, use double quotes, or remove the #{...}.

Reported
...
y = :ok
z = 'a #{b}'
...
/(?<a>x)(?:y)/
...
ruby:
lint:
rules:
interpolation-check: warn # off, warn (default), error

Enabled by the presets: ruby/rubocop.

Suppress one line with sudsy-disable-next-line interpolation-check in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
rubocop Lint/InterpolationCheck full