Skip to content

Commit

Permalink
Fix a path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Suchow authored and mpacer committed Sep 27, 2015
1 parent 0e45cdc commit 69d5f96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions proselint/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import imp

base_url = "prose.lifelinter.com/"
proselint_path = os.path.dirname(os.path.realpath(__file__))


def log_error(line, column, error_code, msg):
Expand Down Expand Up @@ -37,17 +38,18 @@ def proselint(version, file):
checks = []

listing = os.listdir(
os.path.join(os.path.dirname(os.path.realpath(__file__)), "checks"))
os.path.join(proselint_path, "checks"))

for f in listing:
if f[-3:] == ".py" and not f == "__init__.py":
m = imp.load_source("rule", os.path.join("proselint", "checks", f))
m = imp.load_source("", os.path.join(proselint_path, "checks", f))
checks.append(getattr(m, 'check'))

# Apply all the checks.
else:
with open(file, "r") as f:
text = f.read()

for check in checks:
errors = check(text)
if errors:
Expand Down

0 comments on commit 69d5f96

Please sign in to comment.