-
Notifications
You must be signed in to change notification settings - Fork 43
License test updates + exposing the matched position #1462
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
Conversation
/// | ||
/// WARNING: this class is experimental, do not rely on it. | ||
@JsonSerializable() | ||
class Position { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, but would it make sense to make the class represent a range instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would that require: startOffset
, endOffset
, startLine
, endLine
, startColumn
, endColumn
?
Maybe we could have a Range
class with Position start
and Position end
, both required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code with Range
(with start
and stop
). PTAL.
Note: maybe this is an overkill here, but we could also emit a diff format: while marking the recognized range, we could highlight added words and also identify removed words too. Just in case the license was modified in a non-trivial way.
This PR is a preparation to update/improve the license-detection, and to eventually expose the detected license parts on the UI.
Part of #1015 and dart-lang/pub-dev#5359
I am not sure yet if this positioning is enough for the UI, e.g. we could have multiple coverage segments that would show which words were matched in the license text, and which may have been added to it, let's discuss that later (added a warning note of the fields and the class being experimental).