Skip to content

Commit

Permalink
Delay the SourceFile import in lint.
Browse files Browse the repository at this point in the history
Due to the way this code is used in web-platform-tests, the localpaths
import is required in that context, but not in tests in this repository.

This introduces the unfortunate problem that check_parsed() can only be
called through main(), but this is the fastest approach I can think of that
will allow the tests in this repository to keep working, while also
ensuring the lint script in web-platform-tests works.
  • Loading branch information
Ms2ger committed Jun 8, 2016
1 parent 40685f7 commit 5cfea9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lint/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
from six import iteritems
from six.moves import range

from manifest.sourcefile import SourceFile

here = os.path.abspath(os.path.split(__file__)[0])

ERROR_MSG = """You must fix all errors; for details on how to fix them, see
Expand Down Expand Up @@ -155,6 +153,8 @@ def check_regexp_line(repo_root, path, f):
return errors

def check_parsed(repo_root, path, f):
from manifest.sourcefile import SourceFile

source_file = SourceFile(repo_root, path, "/")

errors = []
Expand Down

0 comments on commit 5cfea9a

Please sign in to comment.