From f0596227b137f2c277614e54c8c273d3854bcfbe Mon Sep 17 00:00:00 2001 From: Dana Keeler Date: Thu, 20 Apr 2023 22:24:00 +0000 Subject: [PATCH] Bug 1811645 - avoid an American English colloquialism meaning "nonsense" r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D175802 --- .../test/static/browser_all_files_referenced.js | 2 +- .../content/test/static/browser_parsable_css.js | 2 +- ...browser_removeUnsafeProtocolsFromURLBarPaste.js | 6 +++--- docshell/test/unit/test_URIFixup_search.js | 5 ++--- intl/l10n/test/test_l10nregistry.js | 2 +- mfbt/Tainting.h | 2 +- tools/lint/rejected-words.yml | 13 +++++++++++++ .../mochitest/browser_extension_correction.js | 2 +- .../tests/mochitest/browser_save_filenames.js | 2 +- .../exthandler/tests/mochitest/save_filenames.html | 14 +++++++------- .../tests/unit/test_getFromTypeAndExtension.js | 2 +- 11 files changed, 32 insertions(+), 20 deletions(-) diff --git a/browser/base/content/test/static/browser_all_files_referenced.js b/browser/base/content/test/static/browser_all_files_referenced.js index e66947d3db8e..d8c257381f76 100644 --- a/browser/base/content/test/static/browser_all_files_referenced.js +++ b/browser/base/content/test/static/browser_all_files_referenced.js @@ -418,7 +418,7 @@ trackResourcePrefix("gre"); trackResourcePrefix("app"); function getBaseUriForChromeUri(chromeUri) { - let chromeFile = chromeUri + "gobbledygooknonexistentfile.reallynothere"; + let chromeFile = chromeUri + "nonexistentfile.reallynothere"; let uri = Services.io.newURI(chromeFile); let fileUri = gChromeReg.convertChromeURL(uri); return fileUri.resolve("."); diff --git a/browser/base/content/test/static/browser_parsable_css.js b/browser/base/content/test/static/browser_parsable_css.js index e7db8d69601f..881b3d346716 100644 --- a/browser/base/content/test/static/browser_parsable_css.js +++ b/browser/base/content/test/static/browser_parsable_css.js @@ -225,7 +225,7 @@ trackResourcePrefix("gre"); trackResourcePrefix("app"); function getBaseUriForChromeUri(chromeUri) { - let chromeFile = chromeUri + "gobbledygooknonexistentfile.reallynothere"; + let chromeFile = chromeUri + "nonexistentfile.reallynothere"; let uri = Services.io.newURI(chromeFile); let fileUri = gChromeReg.convertChromeURL(uri); return fileUri.resolve("."); diff --git a/browser/components/urlbar/tests/browser/browser_removeUnsafeProtocolsFromURLBarPaste.js b/browser/components/urlbar/tests/browser/browser_removeUnsafeProtocolsFromURLBarPaste.js index 3793b69bd0ed..4dfbc5c01b35 100644 --- a/browser/components/urlbar/tests/browser/browser_removeUnsafeProtocolsFromURLBarPaste.js +++ b/browser/components/urlbar/tests/browser/browser_removeUnsafeProtocolsFromURLBarPaste.js @@ -43,12 +43,12 @@ var pairs = [ let supportsNullBytes = AppConstants.platform == "macosx"; // Note that \u000d (\r) is missing here; we test it separately because it // makes the test sad on Windows. -let gobbledygook = +let nonsense = "\u000a\u000b\u000c\u000e\u000f\u0010\u0011\u0012\u0013\u0014javascript:foo"; if (supportsNullBytes) { - gobbledygook = "\u0000" + gobbledygook; + nonsense = "\u0000" + nonsense; } -pairs.push([gobbledygook, "foo"]); +pairs.push([nonsense, "foo"]); let supportsReturnWithoutNewline = AppConstants.platform != "win" && AppConstants.platform != "linux"; diff --git a/docshell/test/unit/test_URIFixup_search.js b/docshell/test/unit/test_URIFixup_search.js index 95883302f833..fa1c5b38ba89 100644 --- a/docshell/test/unit/test_URIFixup_search.js +++ b/docshell/test/unit/test_URIFixup_search.js @@ -57,9 +57,8 @@ var data = [ fixed: "http://user:pass@example.com:8080/this/is/a/test.html", }, { - wrong: "gobbledygook:user:pass@example.com:8080/this/is/a/test.html", - fixed: - "http://gobbledygook:user%3Apass@example.com:8080/this/is/a/test.html", + wrong: "nonsense:user:pass@example.com:8080/this/is/a/test.html", + fixed: "http://nonsense:user%3Apass@example.com:8080/this/is/a/test.html", }, { wrong: "user:@example.com:8080/this/is/a/test.html", diff --git a/intl/l10n/test/test_l10nregistry.js b/intl/l10n/test/test_l10nregistry.js index 18413329fb03..cbbb1e731647 100644 --- a/intl/l10n/test/test_l10nregistry.js +++ b/intl/l10n/test/test_l10nregistry.js @@ -350,7 +350,7 @@ add_task(async function test_missing_file() { }); add_task(async function test_hasSource() { - equal(l10nReg.hasSource("gobbledygook"), false, "Non-existing source doesn't exist"); + equal(l10nReg.hasSource("nonsense"), false, "Non-existing source doesn't exist"); equal(l10nReg.hasSource("app"), false, "hasSource returns true before registering a source"); let oneSource = new L10nFileSource("app", "app", ["en-US"], "/{locale}/"); l10nReg.registerSources([oneSource]); diff --git a/mfbt/Tainting.h b/mfbt/Tainting.h index b6cd9cd85246..2df6176f8916 100644 --- a/mfbt/Tainting.h +++ b/mfbt/Tainting.h @@ -72,7 +72,7 @@ class Tainted { // ==================================================================== // ==================================================================== /* - * This section contains non-user-facing C++ gobblygook to support + * This section contains obscure, non-user-facing C++ to support * variable-argument macros. */ #define MOZ_TAINT_GLUE(a, b) a b diff --git a/tools/lint/rejected-words.yml b/tools/lint/rejected-words.yml index 81fc69a00f21..a1b11c7a43ed 100644 --- a/tools/lint/rejected-words.yml +++ b/tools/lint/rejected-words.yml @@ -329,3 +329,16 @@ avoid-blacklist-and-whitelist: # Disable for now. Needs some dev to handle this # avoid-master-and-slave: # description: "Use words like 'controller', 'worker' instead" +--- +avoid-gobbledygook: + description: "American English colloquialism. Use 'nonsense' instead." + level: error + include: ['.'] + type: regex + payload: \b(gobbledy)?-?gook + ignore-case: true + exclude: + - extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/orig/en_US-custom.dic + - extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/utf8/en-US-utf8.dic + - extensions/spellcheck/locales/en-US/hunspell/en-US.dic + - tools/lint/rejected-words.yml diff --git a/uriloader/exthandler/tests/mochitest/browser_extension_correction.js b/uriloader/exthandler/tests/mochitest/browser_extension_correction.js index 17a9bf0bedd6..9a04732cf62d 100644 --- a/uriloader/exthandler/tests/mochitest/browser_extension_correction.js +++ b/uriloader/exthandler/tests/mochitest/browser_extension_correction.js @@ -178,7 +178,7 @@ add_task(async function test_enforce_useful_extension() { await testLinkWithoutExtension("video/webm", true); await testLinkWithoutExtension("application/pdf", true); - await testLinkWithoutExtension("application/x-gobbledygook", false); + await testLinkWithoutExtension("application/x-nonsense", false); await testLinkWithoutExtension("application/octet-stream", false); await testLinkWithoutExtension("binary/octet-stream", false); await testLinkWithoutExtension("application/x-msdownload", false); diff --git a/uriloader/exthandler/tests/mochitest/browser_save_filenames.js b/uriloader/exthandler/tests/mochitest/browser_save_filenames.js index 992de8d454ee..dc652c04f61c 100644 --- a/uriloader/exthandler/tests/mochitest/browser_save_filenames.js +++ b/uriloader/exthandler/tests/mochitest/browser_save_filenames.js @@ -23,7 +23,7 @@ let types = { // so it is used here for this test. js: "application/x-javascript", binary: "application/octet-stream", - gook: "application/x-gook", + nonsense: "application/x-nonsense", zip: "application/zip", json: "application/json", tar: "application/x-tar", diff --git a/uriloader/exthandler/tests/mochitest/save_filenames.html b/uriloader/exthandler/tests/mochitest/save_filenames.html index 9720699a2ceb..54c5dae4195c 100644 --- a/uriloader/exthandler/tests/mochitest/save_filenames.html +++ b/uriloader/exthandler/tests/mochitest/save_filenames.html @@ -73,16 +73,16 @@ - + - + - + @@ -290,7 +290,7 @@ data-unknown="true"> - diff --git a/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js b/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js index 46d43abce472..6f4fe52a49f6 100644 --- a/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js +++ b/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js @@ -6,7 +6,7 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ add_task(async function test_utf8_extension() { const mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); let someMIME = mimeService.getFromTypeAndExtension( - "application/x-gobbledygook", + "application/x-nonsense", ".тест" ); Assert.stringContains(someMIME.description, "тест");