← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/lp-mailman:woke into lp-mailman:master

 

Colin Watson has proposed merging ~cjwatson/lp-mailman:woke into lp-mailman:master with ~cjwatson/lp-mailman:remove-format-imports as a prerequisite.

Commit message:
Apply inclusive naming via the woke pre-commit hook

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/lp-mailman/+git/lp-mailman/+merge/419250
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/lp-mailman:woke into lp-mailman:master.
diff --git a/.gitignore b/.gitignore
index cabc8dd..63884ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,6 @@
 .tags
 version-info.py
 logs/*
-+*
 sourcecode/*
 /tags
 thread*.request
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b1295f8..670e186 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -14,3 +14,7 @@ repos:
     rev: 5.9.2
     hooks:
     -   id: isort
+-   repo: https://github.com/get-woke/woke
+    rev: v0.17.0
+    hooks:
+    -   id: woke-from-source
diff --git a/.woke.yaml b/.woke.yaml
new file mode 100644
index 0000000..010ccff
--- /dev/null
+++ b/.woke.yaml
@@ -0,0 +1,221 @@
+
+# Based on Canonical's Guidelines
+# https://docs.google.com/document/d/1mJUa1VJHOMWa723dmKmNjSKGW-nlBv9xktzGZZwacVo/edit#heading=h.5efudb237qdb
+rules:
+  - name: whitelist
+    terms:
+      - whitelist
+      - white-list
+      - whitelisted
+      - white-listed
+    alternatives:
+      - allowlist
+      - inclusion list
+    severity: warning
+    note: "The underlying assumption of the whitelist/blacklist metaphor is that white = good and black = bad. Because colors in and of themselves have no predetermined meaning, any meaning we assign to them is cultural: for example, the color red in many Southeast Asian countries is lucky, and is often associated with events like marriages, whereas the color white carries the same connotations in many European countries. In the case of whitelist/blacklist, the terms originate in the publishing industry – one dominated by the USA and England, two countries which participated in slavery and which grapple with their racist legacies to this day."
+
+  - name: blacklist
+    terms:
+      - blacklist
+      - black-list
+      - blacklisted
+      - black-listed
+    alternatives:
+      - denylist
+      - blocklist
+      - exclusion list
+    severity: warning
+    note: "The underlying assumption of the whitelist/blacklist metaphor is that white = good and black = bad. Because colors in and of themselves have no predetermined meaning, any meaning we assign to them is cultural: for example, the color red in many Southeast Asian countries is lucky, and is often associated with events like marriages, whereas the color white carries the same connotations in many European countries. In the case of whitelist/blacklist, the terms originate in the publishing industry – one dominated by the USA and England, two countries which participated in slavery and which grapple with their racist legacies to this day."
+
+  - name: master-slave
+    terms:
+      - master-slave
+      - master/slave
+    alternatives:
+      - leader/follower
+      - main/replica
+      - primary/replica
+      - primary/standby
+      - primary/secondary
+
+  - name: slave
+    terms:
+      - slave
+    alternatives:
+      - follower
+      - replica
+      - standby
+
+  - name: grandfathered
+    terms:
+      - grandfathered
+    alternatives:
+      - legacy status
+      - legacied
+      - exempted
+      - carried
+      - brought forward
+      - rolled over
+
+  - name: man-hours
+    terms:
+      - man hours
+      - man-hours
+    alternatives:
+      - person hours
+      - engineer hours
+
+  - name: sanity
+    terms:
+      - sanity
+    alternatives:
+      - confidence
+      - quick check
+      - coherence check
+
+  - name: dummy
+    terms:
+      - dummy
+    alternatives:
+      - placeholder
+      - sample
+
+  - name: guys
+    terms:
+      - guys
+    alternatives:
+      - folks
+      - people
+      - you all
+      - y'all
+      - yinz
+
+  - name: whitebox
+    terms:
+      - white-box
+      - whitebox
+      - white box
+    alternatives:
+      - open-box
+
+  - name: blackbox
+    terms:
+      - black-box
+      - blackbox
+      - black box
+    alternatives:
+      - closed-box
+
+  - name: blackhat
+    terms:
+      - blackhat
+      - black-hat
+      - black hat
+    alternatives:
+      - attacker
+      - malicious actor
+
+  - name: whitehat
+    terms:
+      - whitehat
+      - white-hat
+      - white hat
+    alternatives:
+      - researcher
+      - security specialist
+
+  - name: illegal characters
+    terms:
+      - illegal characters
+    alternatives:
+      - invalid characters
+      - unsupported characters
+      - special characters
+
+  - name: native feature
+    terms:
+      - native feature
+    alternatives:
+      - core feature
+      - built-in feature
+
+  - name: chairman/foreman
+    terms:
+      - chairman
+      - foreman
+    alternatives:
+      - chair
+      - foreperson
+
+  - name: man in the middle
+    terms:
+      - man in the middle
+      - man-in-the-middle
+    alternatives:
+      - machine-in-the-middle
+      - person-in-the-middle
+      - system-in-the-middle
+      - intermediary attack
+
+  - name: middleman
+    terms:
+      - middleman
+    alternatives:
+      - middleperson
+      - intermediary
+
+  - name: manned
+    terms:
+      - manned
+    alternatives:
+      - crewed
+      - staffed
+      - monitored
+      - human operated
+
+  - name: mom test / girlfriend test
+    terms:
+      - mom test
+      - girlfriend test
+    alternatives:
+      - user test
+      - user friendly
+
+  - name: crazy
+    terms:
+      - crazy
+    alternatives:
+      - baffling
+      - unexplained
+      - errant
+
+  - name: cripples
+    terms:
+      - cripples
+    alternatives:
+      - slows down
+      - hinders
+      - obstructs
+
+  - name: crippling
+    terms:
+      - crippling
+    alternatives:
+      - attenuating
+      - incapacitating
+
+  - name: stonith/stomith
+    terms:
+      - stonith
+      - stomith
+    alternatives:
+      - fence failed nodes
+      - machines
+
+  - name: demilitarized zone
+    terms:
+      - demilitarized zone
+      - dmz
+    alternatives:
+      - perimeter network
+      - passthrough network
diff --git a/lib/lp/services/mailman/monkeypatches/xmlrpcrunner.py b/lib/lp/services/mailman/monkeypatches/xmlrpcrunner.py
index 66bdaa2..864494a 100644
--- a/lib/lp/services/mailman/monkeypatches/xmlrpcrunner.py
+++ b/lib/lp/services/mailman/monkeypatches/xmlrpcrunner.py
@@ -114,9 +114,9 @@ class XMLRPCRunner(Runner):
         # initialize the two attributes that are actually used.  The reason
         # for this is that the XMLRPCRunner doesn't have a queue so it
         # shouldn't be trying to create a Switchboard instance.  Still, it
-        # needs a dummy _kids and _stop attributes for the rest of the runner
-        # to work.  We're using runners in a more general sense than Mailman 2
-        # is designed for.
+        # needs placeholder _kids and _stop attributes for the rest of the
+        # runner to work.  We're using runners in a more general sense than
+        # Mailman 2 is designed for.
         self._kids = {}
         self._stop = False
         self._proxy = get_mailing_list_api_proxy()
diff --git a/lib/lp/services/scripts/__init__.py b/lib/lp/services/scripts/__init__.py
index 780803b..7dd28ad 100644
--- a/lib/lp/services/scripts/__init__.py
+++ b/lib/lp/services/scripts/__init__.py
@@ -7,16 +7,16 @@
 __metaclass__ = type
 
 __all__ = [
-    'dummy_logger_options',
     'log',
     'logger',
     'logger_options',
+    'placeholder_logger_options',
     ]
 
 # these are intentional re-exports, apparently, used by *many* files.
 from lp.services.scripts.logger import (
-    dummy_logger_options,
     log,
     logger,
     logger_options,
+    placeholder_logger_options,
     )
diff --git a/lib/lp/services/scripts/base.py b/lib/lp/services/scripts/base.py
index dc784bf..73f5ea1 100644
--- a/lib/lp/services/scripts/base.py
+++ b/lib/lp/services/scripts/base.py
@@ -146,7 +146,7 @@ class LaunchpadScript:
                         "Run the script under the profiler and save the "
                         "profiling stats in FILE."))
         else:
-            scripts.dummy_logger_options(self.parser)
+            scripts.placeholder_logger_options(self.parser)
 
         self.add_my_options()
         self.options, self.args = self.parser.parse_args(args=test_args)
diff --git a/lib/lp/services/scripts/logger.py b/lib/lp/services/scripts/logger.py
index cc26244..ecf1f88 100644
--- a/lib/lp/services/scripts/logger.py
+++ b/lib/lp/services/scripts/logger.py
@@ -18,11 +18,11 @@ __all__ = [
     'DEBUG7',
     'DEBUG8',
     'DEBUG9',
-    'dummy_logger_options',
     'LaunchpadFormatter',
     'log',
     'logger',
     'logger_options',
+    'placeholder_logger_options',
     ]
 
 
@@ -131,8 +131,8 @@ def do_nothing(*args, **kwargs):
     """Do absolutely nothing."""
 
 
-def dummy_logger_options(parser):
-    """Add dummy --verbose and --quiet options to `parser`."""
+def placeholder_logger_options(parser):
+    """Add placeholder --verbose and --quiet options to `parser`."""
     define_verbosity_options(parser, None, do_nothing, do_nothing)
 
 
diff --git a/lib/lp/services/scripts/tests/__init__.py b/lib/lp/services/scripts/tests/__init__.py
index 8b7e708..558455f 100644
--- a/lib/lp/services/scripts/tests/__init__.py
+++ b/lib/lp/services/scripts/tests/__init__.py
@@ -27,8 +27,7 @@ SCRIPT_LOCATIONS = [
 def find_lp_scripts():
     """Find all scripts/ files in the current tree.
 
-    Skips filename starting with '_' or not ending with '.py' or
-    listed in the KNOWN_BROKEN blacklist.
+    Skips filename starting with '_' or not ending with '.py'.
     """
     scripts = []
     for script_location in SCRIPT_LOCATIONS: