-
-
Notifications
You must be signed in to change notification settings - Fork 556
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
Add required phrase rules automatically #3254
Conversation
Add a script which can add required phrases in already existing rules automatically from license field names, and can do this one license expression at a time. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
These were added automatically by the script added at etc/scripts/licenses/add_required_phrases.py Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
7e8b972
to
48370a5
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
* moves the script to licensedcode * adds a new console script `add-required-phrases` * move the functions and tests to seperate files Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
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.
Here are some comments for your consideration.
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
66f2be5
to
f13b100
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
This is done only on `mit` rules, by running: add-required-phrases -ovr --license-expression "mit" Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
4fbbdcf
to
623fe6c
Compare
623fe6c
to
02157f0
Compare
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.
Some minor nits and a question on the is_required_phrase flag for your consideration!
'but is an essential section of the rule text which must be ' | ||
'present in the case of partial matches, otherwise the match ' | ||
'will be a false positive and misleading.') | ||
) |
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.
I wonder if this would not be best computed an index time ... this is True if a rule text is entirely a required phrase, this would mean one less stored flag.
02157f0
to
c427e01
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
c427e01
to
04ae85d
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
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.
Looking fine!
Closing this as we now have #3924 |
Reference: #2637 #2878
Tasks
Run tests locally to check for errors.