-
Notifications
You must be signed in to change notification settings - Fork 46
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
Handle third party trademarks #168
base: main
Are you sure you want to change the base?
Handle third party trademarks #168
Conversation
Verification #11294314: pass |
third_party_trademark_re = re.compile( | ||
r'(?i:(' + '|'.join(third_party_trademarks) | ||
+ r'))([*®™]|®|™|©|\\\*)?') |
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.
urgh, I can't read this. Can you document what you mean with a unit test? A simple assert third_party_trademark_re.match(...) == ...
on top level is sufficient.
Also, if you want to capture this in the future, then I suggest allowlist rather than blocklist, i.e. complain if the word before ®
or ™
does not match smth like Intel, Simics, DML.
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.
urgh, I can't read this. Can you document what you mean with a unit test? A simple assert third_party_trademark_re.match(...) == ... on top level is sufficient.
The regex can actually be improved a small bit (the second group doesn't need to try to match against anything but *
or \*
), but yes, I can do a unit test.
Also, if you want to capture this in the future, then I suggest allowlist rather than blocklist, i.e. complain if the word before ® or ™ does not match smth like Intel, Simics, DML.
Not good enough, that doesn't catch people using an external trademark without annotating it with an *
, and that's the main point of the check.
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.
Actually I want to keep the regex as-is and capitalize on it instead. Currently we check that an external trademark is annotated with * at least once per section it's referenced in. However, we should also check that no reference to an external trademark is annotated with ®
or ™
.
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.
If you want to protect from using external trademarks without *
, then you need a much bigger list, because the world has more than two trademarked things.
And if we are to make this kind of check, then it's better to do it globally for all simics docs.
acknowledgement = r''' | ||
*** | ||
<sub>\* Other names and brands may be claimed as the property of others.</sub> | ||
''' | ||
|
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.
This should not be part of the md_to_github script: The md sources are compiled into both simics-native docs and into github wiki, so better fix this in the md sources instead. Or is this stuff also auto-added by dodoc?
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.
The Simics Online Documentation will have a separate solution that won't require authors to manually add acknowledgment lines. So this DML wiki exclusive logic should indeed be DML wiki exclusive.
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.
Alternatively... the DML wiki could have a * Legal Information
page... hmm...
Though that could be more cumbersome than an acknowledgement line (or awkward, if all it contains is the acknowledgement line)
SIMICS-20769, SIMICS-20537, and SIMICS-20761