-
Notifications
You must be signed in to change notification settings - Fork 218
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 inclusive words filter #931
Conversation
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/InclusiveWordsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/AbstractModelTextValidator.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Outdated
Show resolved
Hide resolved
6597124
to
0a9d164
Compare
smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java
Outdated
Show resolved
Hide resolved
:header-rows: 1 | ||
:widths: 20 20 60 | ||
|
||
* - Property |
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.
Are either of these properties required? What's the default value for appendDefaults
if it's not 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.
Will add documentation. It is worth noting there is a non-trivial, maybe counter intuitive defaults behavior:
Though appendDefaults
defaults to false, if noninclusiveTerms
mappings is entirely unset or empty, appendDefaults
behaves as if it were true -- the built in mappings are present. noninclusiveTerms
has to be non-empty before appendDefaults
behavior applies. If this behavior is acceptable, then I'll focus on clear and concise documentation for it. If not, then I should change the implementation.
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.
Property structure have changed a bit. But current properties are documented for required or not, along with what the default values are
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.
Is the reasoning for this structure change because you weren't happy with the behavior? I feel like a terms map and a includeDefaults
-like boolean that defaults to true would be pretty clear and usable for customers.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Outdated
Show resolved
Hide resolved
========= | ||
|
||
Validates that all text content in a model (i.e. shape names, member names, | ||
documentation, trait values, etc.) do not contain words that perpetuate cultural |
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 looks like it returned or wasn't fixed initially.
smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java
Outdated
Show resolved
Hide resolved
:header-rows: 1 | ||
:widths: 20 20 60 | ||
|
||
* - Property |
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.
Is the reasoning for this structure change because you weren't happy with the behavior? I feel like a terms map and a includeDefaults
-like boolean that defaults to true would be pretty clear and usable for customers.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java
Outdated
Show resolved
Hide resolved
smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java
Outdated
Show resolved
Hide resolved
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.
Let's squash this PR on merge if it's viable.
b57e634
to
b734074
Compare
Issue #, if available:
Description of changes:
TODO:
Testing so far has been local. Follow up commit will add checked-in unit tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.