aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/cert_generator.sh6
-rw-r--r--python/tidy/servo_tidy/tidy.py7
-rw-r--r--python/tidy/servo_tidy_tests/long_line.rs1
3 files changed, 10 insertions, 4 deletions
diff --git a/etc/cert_generator.sh b/etc/cert_generator.sh
index 7fda11c1478..a558420f99a 100755
--- a/etc/cert_generator.sh
+++ b/etc/cert_generator.sh
@@ -18,9 +18,7 @@ set -o pipefail
# (some are Email-only), column 30 is printed, the raw certificate.
# 6. All CA certs trusted for Websites are stored into the `certs` file.
-domain="ccadb-public.secure.force.com";
-curl "https://${domain}/mozilla/IncludedCACertificateReportPEMCSV" -sSf | \
-gawk -v RS="\"\n" -F'","|^"' \
+url="https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateReportPEMCSV"
+curl "${url}" -sSf | gawk -v RS="\"\n" -F'","|^"' \
'{gsub("\047","",$(30));gsub("\"","",$(30));if($(13)~/Websites/)print $(30)}' \
> certs
-
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index a8c4246ce09..35ebcb656db 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -32,6 +32,8 @@ def wpt_path(*args):
CONFIG_FILE_PATH = os.path.join(".", "servo-tidy.toml")
WPT_MANIFEST_PATH = wpt_path("include.ini")
+# regex source https://stackoverflow.com/questions/6883049/
+URL_REGEX = re.compile('https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+')
# Import wptmanifest only when we do have wpt in tree, i.e. we're not
# inside a Firefox checkout.
@@ -261,8 +263,13 @@ def check_length(file_name, idx, line):
yield (idx + 1, "Line is longer than %d characters" % max_length)
+def contains_url(line):
+ return bool(URL_REGEX.search(line))
+
+
def is_unsplittable(file_name, line):
return (
+ contains_url(line) or
file_name.endswith(".rs") and
line.startswith("use ") and
"{" not in line
diff --git a/python/tidy/servo_tidy_tests/long_line.rs b/python/tidy/servo_tidy_tests/long_line.rs
index 4d2a0c5cf4f..6427aa50878 100644
--- a/python/tidy/servo_tidy_tests/long_line.rs
+++ b/python/tidy/servo_tidy_tests/long_line.rs
@@ -3,3 +3,4 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
println!("really really loooooooooooooooooooooooooooooooooooooooooooong lineeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+let url = "http://www.should.skip/really-looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong-url-strings";