pre-submit: Add reference to search_blocked_words.sh
This patch adds a reference to search_blocked_words.sh, which prints
the number of occurrences of blocked words.
It also adds a comment to unblocked_terms.txt to avoid removal.
BUG=b:165908442
TEST=None
Change-Id: Id5926e66e9da5f8ecdd20d8f67b7670cb6b5f795
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/repohooks/+/2404957
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/README.md b/README.md
index e90eabb..bf2f671 100644
--- a/README.md
+++ b/README.md
@@ -128,25 +128,29 @@
## Blocked and Unblocked Word List
-`blocked_terms.txt` contains a list of words which are blocked if
-`keyword_check` is enabled in the project. `unblocked_terms.txt` is a copy of
-`blocked_terms.txt`. So, by default nothing will be blocked.
+`blocked_terms.txt` contains a default list of words which are blocked by
+keyword_check. `unblocked_terms.txt` is a default list of words which are
+unblocked. They have the same contents. So, by default nothing is blocked.
-`unblocked_terms.txt` in this directry is referenced only if it doesn't exist in
-a project directory. To transition to the default blocked word list for project
-X, one can do:
+The global `unblocked_terms.txt` is referenced only if a copy doesn't exist in a
+project. Thus, by copying `unblocked_terms.txt` to your project, you can start
+blocking changes which contain words not listed in the project's
+`unblocked_terms.txt`:
-1. Copy `unblocked_terms.txt` to X.
-2. Remove words which are not used in X.
- `$ egrep -r -i -I '(keyword1|keyword2|...)'`
-3. Test and submit CL.
+1. Copy `unblocked_terms.txt` to the project's root directory.
+2. List which words are already cleared (or not present):
+ ```$ ~/chromiumos/src/platform/dev/contrib/search_blocked_words.sh```
+3. Remove the cleared words from the project's `unblocked_terms.txt`
+4. Test and submit CL.
-Then, when blocking word 'foo' for project X, one can do:
+When later making the project more inclusive, you can do:
-1. Remove 'foo' from `unblocked_terms.txt` in X.
-2. Grep and fix matches.
- `$ egrep -r -i -I foo`
-3. Test & submit CL.
+1. Pick a word from the project's `unblocked_terms.txt`.
+2. Fix all occurrences of the word.
+3. Verify the clearance:
+ ```$ ~/chromiumos/src/platform/dev/contrib/search_blocked_words.sh```
+4. Remove the word from the project's `unblocked_terms.txt`.
+5. Test and submit CL.
# Third Party code
diff --git a/blocked_terms.txt b/blocked_terms.txt
index 1e1f9e3..7f0134d 100644
--- a/blocked_terms.txt
+++ b/blocked_terms.txt
@@ -3,8 +3,11 @@
# This is the global list of words to be blocked. unblocked_terms.txt has the
# same contents. Copy unblocked_terms.txt to your project to enable repo hook to
# block the words.
+
+# KEEP THIS COMMENT IN YOUR COPY.
#
-# See repohooks/README.md for more details.
+# Don't delete this file if you want to keep keyword_check enabled even if it's
+# empty. See repohooks/README.md for more details.
black.?hat
black.?list