lpil / dogma

:closed_lock_with_key: A code style linter for Elixir
Other
471 stars 52 forks source link

Incorrect rule match in SpaceAfterComma #235

Closed techgaun closed 6 years ago

techgaun commented 7 years ago

Seems like the root cause is how Dogma.Util.ScriptStrings strips the string literal contents and it seems to affect SpaceAfterComma. If there's a code with comment that contains single double-quote, it seems to create this issue.

Below is the sample code-block that can produce this behavior:

# "
IO.puts ","
lpil commented 7 years ago

Thanks :)

Dogma.Util.ScriptStrings needs to be re-written to be honest, there's a ton of edge cases it doesn't handle correctly.

SpaceAfterComma could be smarter too. Checking the source directly isn't very robust.