-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Results #90
Comments
a result shall implement comparision operators for ordering! |
I have reduced this to LineResult and Result only. Though we need a diff result or so, right? |
result comparision is evil... just pointing out |
What do you think of such a thing: def __lt__(self, other):
if not isinstance(other, Result):
raise TypeError("Comparision with non-result classes is not supported.")
# Show elements without files first
if self.file is None != other.file is None:
return other.file is None
# Now either both .file members are None or both are set
if self.file != other.file:
return self.file < other.file
# Both files are equal
if self.severity != other.severity:
return self.severity < other.severity
# Severities are equal, files are equal
if self.origin != other.origin:
return self.origin < other.origin
return self.message < other.message |
this gets fixed with commit c533f37 |
both of these results are implemented, we'll neeed an own bug for a diffresult or so. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We'll need some result types:
The text was updated successfully, but these errors were encountered: