View Source Credo.Check.Readability.StringSigils (Credo v1.7.5)


This check is enabled by default.

Learn how to disable it via .credo.exs.

This check has a base priority of low and works with any version of Elixir.


If you used quoted strings that contain quotes, you might want to consider switching to the use of sigils instead.

# okay

"<a href=\"\">#\{text}</a>"

# not okay, lots of escaped quotes

"<a href=\"\" target=\"_blank\">#\{text}</a>"

# refactor to

~S(<a href="" target="_blank">#\{text}</a>)

This allows us to remove the noise which results from the need to escape quotes within quotes.

Like all Readability issues, this one is not a technical concern. But you can improve the odds of others reading and liking your code by making it easier to follow.

Check-Specific Parameters

Use the following parameters to configure this check:


The maximum amount of escaped quotes you want to tolerate.

This parameter defaults to 3.

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.