Skip to content
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

Closed
2 tasks done
sils opened this issue Oct 23, 2014 · 6 comments
Closed
2 tasks done

Implement Results #90

sils opened this issue Oct 23, 2014 · 6 comments

Comments

@sils
Copy link
Member

sils commented Oct 23, 2014

We'll need some result types:

  • AnnotationResult
  • LineResult (associated to a specific line, allows a replacement)
@sils sils added this to the 0.1 alpha milestone Oct 23, 2014
@sils sils self-assigned this Oct 23, 2014
@sils sils mentioned this issue Oct 23, 2014
3 tasks
@sils
Copy link
Member Author

sils commented Oct 23, 2014

a result shall implement comparision operators for ordering!

@sils
Copy link
Member Author

sils commented Oct 23, 2014

I have reduced this to LineResult and Result only. Though we need a diff result or so, right?

@sils
Copy link
Member Author

sils commented Oct 29, 2014

result comparision is evil... just pointing out

@sils
Copy link
Member Author

sils commented Oct 29, 2014

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

@sils
Copy link
Member Author

sils commented Oct 29, 2014

this gets fixed with commit c533f37

@sils
Copy link
Member Author

sils commented Dec 11, 2014

both of these results are implemented, we'll neeed an own bug for a diffresult or so.

@sils sils closed this as completed Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant