DEV: more precise self pattern check (#7278)

This commit is contained in:
Joffrey JAFFEUX 2019-03-29 08:50:18 +01:00 committed by GitHub
parent a6d93f6317
commit 843a73e1ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ js_files.each do |path|
diff.patch.lines.grep(/^\+\s\s/).each do |added_line|
super_offenses << path if added_line['this._super()']
self_offenses << path if added_line['self']
self_offenses << path if added_line[/(?:(^|\W)self\.?)/]
end
end
@ -51,7 +51,7 @@ end
if !self_offenses.empty?
warn(%{
Use fat arrow instead of self pattern.`\n
Use fat arrow instead of self pattern.\n
#{self_offenses.uniq.map { |o| github.html_link(o) }.join("\n")}
})
end