Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/rubustrings/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ def validate_translation_line(file_name, line, only_format)
line_number = numbered_line_match[1]
line = numbered_line_match[2]

# skip # character, single line and multi line comments.
comments_regex = /(?:#[^\n]*|\/\/[^\n]*|\/\*(?:(?!\*\/).)*\*\/)/
return true if comments_regex.match line

match = validate_format line
return log_output(:error, file_name, line_number, "invalid format: #{line}") unless match

Expand Down