Auto merge of #22651 - shanavas786:skip-tidy-checkk, r=SimonSapin

Skip line length check on url strings

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22498

<!-- Either: -->
- [x] There are tests for these changes
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22651)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-01-08 14:18:09 -05:00 committed by GitHub
commit 0453e8ff5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -18,9 +18,7 @@ set -o pipefail
# (some are Email-only), column 30 is printed, the raw certificate. # (some are Email-only), column 30 is printed, the raw certificate.
# 6. All CA certs trusted for Websites are stored into the `certs` file. # 6. All CA certs trusted for Websites are stored into the `certs` file.
domain="ccadb-public.secure.force.com"; url="https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateReportPEMCSV"
curl "https://${domain}/mozilla/IncludedCACertificateReportPEMCSV" -sSf | \ curl "${url}" -sSf | gawk -v RS="\"\n" -F'","|^"' \
gawk -v RS="\"\n" -F'","|^"' \
'{gsub("\047","",$(30));gsub("\"","",$(30));if($(13)~/Websites/)print $(30)}' \ '{gsub("\047","",$(30));gsub("\"","",$(30));if($(13)~/Websites/)print $(30)}' \
> certs > certs

View file

@ -32,6 +32,8 @@ def wpt_path(*args):
CONFIG_FILE_PATH = os.path.join(".", "servo-tidy.toml") CONFIG_FILE_PATH = os.path.join(".", "servo-tidy.toml")
WPT_MANIFEST_PATH = wpt_path("include.ini") 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 # Import wptmanifest only when we do have wpt in tree, i.e. we're not
# inside a Firefox checkout. # 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) 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): def is_unsplittable(file_name, line):
return ( return (
contains_url(line) or
file_name.endswith(".rs") and file_name.endswith(".rs") and
line.startswith("use ") and line.startswith("use ") and
"{" not in line "{" not in line

View file

@ -3,3 +3,4 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
println!("really really loooooooooooooooooooooooooooooooooooooooooooong lineeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"); println!("really really loooooooooooooooooooooooooooooooooooooooooooong lineeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
let url = "http://www.should.skip/really-looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong-url-strings";