From 0a0eb2ebe17bebbefbaba3497173cacdd9cb02b1 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 10 Jun 2020 16:15:44 +0200 Subject: [PATCH] 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 --- codespell_lib/_codespell.py | 1 + codespell_lib/data/dictionary_usage.txt | 4 ++++ codespell_lib/tests/test_dictionary.py | 2 ++ 3 files changed, 7 insertions(+) create mode 100644 codespell_lib/data/dictionary_usage.txt diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index b629161c561..06a4344d315 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', False, False), ('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_usage.txt b/codespell_lib/data/dictionary_usage.txt new file mode 100644 index 00000000000..a679ef5e530 --- /dev/null +++ b/codespell_lib/data/dictionary_usage.txt @@ -0,0 +1,4 @@ +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, diff --git a/codespell_lib/tests/test_dictionary.py b/codespell_lib/tests/test_dictionary.py index 23498747f8a..d840ea7aa2c 100644 --- a/codespell_lib/tests/test_dictionary.py +++ b/codespell_lib/tests/test_dictionary.py @@ -175,6 +175,8 @@ def test_error_checking_in_aspell(err, rep, err_aspell, rep_aspell, match): 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'), }