You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# sobelow_skip ["DOS.StringToAtom"] (atoms are a fixed set of table names in the DB schema)
defp get_table_sizes() do
…
end
The explanation given at the end of the sobelow_skip line will cause parsing to silently fail for the whole file when --skip is used. This is a insidious failure, since it will seem like the comment is working but we're also now ignoring any other findings in the file.
This is because of a regex that runs during parsing to convert these comment lines to @sobelow module attribute statements. The regex replaces the first part of the line but not any trailing content, which becomes garbage at the end of the attribute statement.
I see two ways to fix the regex:
Don't match if sobelow_skip is followed by other content. So we fail to skip the finding but the failure is visible to the user.
Consider a code snippet like this:
The explanation given at the end of the
sobelow_skip
line will cause parsing to silently fail for the whole file when--skip
is used. This is a insidious failure, since it will seem like the comment is working but we're also now ignoring any other findings in the file.This is because of a regex that runs during parsing to convert these comment lines to
@sobelow
module attribute statements. The regex replaces the first part of the line but not any trailing content, which becomes garbage at the end of the attribute statement.I see two ways to fix the regex:
sobelow_skip
is followed by other content. So we fail to skip the finding but the failure is visible to the user.sobelow_ignore
line silently breaks parsing #169).The text was updated successfully, but these errors were encountered: