Skip to content

Commit

Permalink
Merge pull request #19 from w3c/sideshowbarker/console-lint
Browse files Browse the repository at this point in the history
lint for usage of console.*
  • Loading branch information
sideshowbarker committed Aug 16, 2015
2 parents 83cdce6 + 1d99b1e commit ae5515f
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 ae5515f

Please sign in to comment.