Add renaming advice based on IETF draft-knodel-terminology-00 (#1556) * Add renaming advice based on IETF draft-knodel-terminology-00 Add a new "usage" dictionary with usage advice based on: https://tools.ietf.org/id/draft-knodel-terminology-00.html#rfc.section.1.1.1 Offer to replace master/slave with: - Primary-secondary - Leader-follower - Active-standby - Primary-replica - Writer-reader - Coordinator-worker - Parent-helper * Move recommended terms to "usage" dictionary Backout the changes from commit 98ab0fa and move them into the "usage" dictionary. * Fix use of "whitelist" in README Use the recommended replacement "allowlist" * Update codespell_lib/_codespell.py Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
diff --git a/README.rst b/README.rst index 92138e8..fc961bf 100644 --- a/README.rst +++ b/README.rst
@@ -41,11 +41,11 @@ codespell -I FILE, --ignore-words=FILE -The ``-I`` flag can be used to whitelist certain words that are in the ``codespell_lib/data/dictionary.txt``. The format of the whitelist file is one word per line. Invoke using: ``codespell -I path/to/file.txt`` to execute codespell referencing said whitelist. **Important note:** The whitelist passed to ``-I`` is case-sensitive based on how it is listed in ``dictionary.txt``. :: +The ``-I`` flag can be used for a list of certain words to allow that are in the codespell dictionaries. The format of the file is one word per line. Invoke using: ``codespell -I path/to/file.txt`` to execute codespell referencing said list of allowed words. **Important note:** The list passed to ``-I`` is case-sensitive based on how it is listed in the codespell dictionaries. :: codespell -L word1,word2,word3,word4 -The ``-L`` flag can be used to whitelist certain words that are comma-separated placed immediately after it. :: +The ``-L`` flag can be used to allow certain words that are comma-separated placed immediately after it. :: codespell -S, --skip=
diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index b629161..17fc3b9 100755 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py
@@ -43,6 +43,7 @@ ('clear', 'for unambiguous errors', '', False, None), ('rare', 'for rare but valid words', '_rare', None, None), ('informal', 'for informal words', '_informal', True, True), + ('usage', 'for recommended terms', '_usage', None, None), ('code', 'for words common to code and/or mathematics', '_code', None, None), # noqa: E501 ('names', 'for valid proper names that might be typos', '_names', None, None), # noqa: E501 ('en-GB_to_en-US', 'for corrections from en-GB to en-US', '_en-GB_to_en-US', True, True), # noqa: E501
diff --git a/codespell_lib/data/dictionary.txt b/codespell_lib/data/dictionary.txt index 1307f90..f0f1adb 100644 --- a/codespell_lib/data/dictionary.txt +++ b/codespell_lib/data/dictionary.txt
@@ -3556,7 +3556,7 @@ bject->object bjects->objects blackslashes->backslashes -blaclist->blocklist +blaclist->blacklist blaim->blame blaimed->blamed blak->black, blank, @@ -28091,10 +28091,10 @@ whihc->which whihch->which whilest->whilst -whiltelist->allowlist -whiltelisted->allowlisted -whiltelisting->allowlisting -whiltelists->allowlists +whiltelist->whitelist +whiltelisted->whitelisted +whiltelisting->whitelisting +whiltelists->whitelists whilw->while whioch->which whiped->wiped
diff --git a/codespell_lib/data/dictionary_rare.txt b/codespell_lib/data/dictionary_rare.txt index 8a134b9..cd425c0 100644 --- a/codespell_lib/data/dictionary_rare.txt +++ b/codespell_lib/data/dictionary_rare.txt
@@ -6,7 +6,6 @@ automatizes->automates backword->backward backwords->backwards -blacklist->blocklist bloc->block blocs->blocks bodgy->body @@ -135,7 +134,6 @@ whats->what's whet->when, what, wet, whiling->while -whitelist->allowlist wight->weight, white, right, write, wights->weights, whites, rights, writes, wit->with
diff --git a/codespell_lib/data/dictionary_usage.txt b/codespell_lib/data/dictionary_usage.txt new file mode 100644 index 0000000..fb114f0 --- /dev/null +++ b/codespell_lib/data/dictionary_usage.txt
@@ -0,0 +1,8 @@ +blacklist->blocklist +blacklists->blocklists +master->primary, leader, active, writer, coordinator, parent, +masters->primaries, leaders, actives, writers, coordinators, parents, +slave->secondary, follower, standby, replica, reader, worker, helper, +slaves->secondaries, followers, standbys, replicas, readers, workers, helpers, +whitelist->allowlist +whitelists->allowlists
diff --git a/codespell_lib/tests/test_dictionary.py b/codespell_lib/tests/test_dictionary.py index 2349874..d840ea7 100644 --- a/codespell_lib/tests/test_dictionary.py +++ b/codespell_lib/tests/test_dictionary.py
@@ -175,6 +175,8 @@ allowed_dups = { ('dictionary.txt', 'dictionary_en-GB_to_en-US.txt'), ('dictionary.txt', 'dictionary_rare.txt'), + ('dictionary.txt', 'dictionary_usage.txt'), + ('dictionary_rare.txt', 'dictionary_usage.txt'), }