Skip to content

Commit

Permalink
lint for usage of console.*
Browse files Browse the repository at this point in the history
Fixes #18.
  • Loading branch information
sideshowbarker committed Jul 9, 2015
1 parent 04dea96 commit 1d99b1e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lint/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ class Webidl2Regexp(Regexp):
pattern = "webidl2\.js"
error = "WEBIDL2.JS"

class ConsoleRegexp(Regexp):
pattern = "console\.[a-zA-Z]+\s*\("
error = "CONSOLE"
file_extensions = [".html", ".htm", ".js", ".xht", ".html", ".svg"]

class PrintRegexp(Regexp):
pattern = "print(?:\s|\s*\()"
error = "PRINT STATEMENT"
Expand All @@ -126,6 +131,7 @@ class PrintRegexp(Regexp):
CRRegexp,
W3CTestOrgRegexp,
Webidl2Regexp,
ConsoleRegexp,
PrintRegexp]]

def check_regexp_line(path, f):
Expand Down

0 comments on commit 1d99b1e

Please sign in to comment.