Open
Description
A sniff to examine code and comments for the use of non-inclusive language and throw a warning when found.
Specifically, the sniff should look for sexist, racist, ablist or ethnocentric language, which can contribute to a hostile work environment.
Initial word list
Search for | Alternatives to suggest | Notes |
---|---|---|
whitelist, blacklist | allowlist/safelist/acceptlist, denylist/blocklist/rejectlist | |
master, slave | primary/main, secondary/replica | |
he, she, him, her, his, himself, herself | they, them, their, themself | may need to limit this search to comments |
crazy | peculiar, baffling | |
dummy | placeholder |
Input requested and very welcome !!!
Particularly on:
- additional words/terms to look for;
- what should be the preferred alternatives.
What to examine:
Search for these in:
- Comments and docblocks.
- Variable names
- Constant names
- Namespace names
- Class names
- Function names
For constructs, report on these only when the construct is declared, not when used, as usage cannot be changed until the declaration has been changed.
Additional notes:
- The sniff should be aware of variants of words, i.e.
$white_list
,whitelisting
etc. - The regexes used should be careful not to match too much, i.e.
sheer
should not matchshe
, whilemaster
should not matchmastering
.
External references: