Skip to content

Commit

Permalink
Merge pull request #22 from cs50/develop
Browse files Browse the repository at this point in the history
Update to 2.1.4
  • Loading branch information
Kareem Zidane authored Aug 29, 2017
2 parents 0e83336 + 8683fb7 commit c54867d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"console_scripts": ["style50=style50.__main__:main"],
},
url="https://github.com/cs50/style50",
version="2.1.3"
version="2.1.4"
)
16 changes: 9 additions & 7 deletions style50/style50.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,15 @@ def run_json(self):
try:
results = self._check(file)
except Error as e:
termcolor.cprint(e.msg, "yellow", file=sys.stderr)
continue

checks[file] = {
"comments": results.comment_ratio >= results.COMMENT_MIN,
"diff": "<pre>{}</pre>".format("\n".join(self.html_diff(results.original, results.styled))),
}
checks[file] = {
"error": e.msg
}
else:
checks[file] = {
"score": results.score,
"comments": results.comment_ratio >= results.COMMENT_MIN,
"diff": "<pre>{}</pre>".format("\n".join(self.html_diff(results.original, results.styled))),
}

json.dump(checks, sys.stdout)

Expand Down

0 comments on commit c54867d

Please sign in to comment.