Rollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-Simulacrum

Add goml scripts to tidy checks

r? ``@notriddle``
This commit is contained in:
Michael Goulet 2023-01-08 19:57:56 -08:00 committed by GitHub
commit bb6a88ad5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 45 additions and 16 deletions

View File

@ -27,4 +27,8 @@ assert-css-false: (".content .out-of-band .since::before", { "content": "\"Since
goto: "file://" + |DOC_PATH| + "/settings.html"
size: (400, 600)
// Ignored for now https://github.com/rust-lang/rust/issues/93784.
// compare-elements-position-near-false: ("#preferred-light-theme .setting-name", "#preferred-light-theme .choice", {"y": 16})
// compare-elements-position-near-false: (
// "#preferred-light-theme .setting-name",
// "#preferred-light-theme .choice",
// {"y": 16},
// )

View File

@ -31,13 +31,28 @@ define-function: (
call-function: (
"check-logo",
("ayu", "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"),
{
"theme": "ayu",
"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) " +
"drop-shadow(rgb(255, 255, 255) 0px 1px 0px) " +
"drop-shadow(rgb(255, 255, 255) -1px 0px 0px) " +
"drop-shadow(rgb(255, 255, 255) 0px -1px 0px)",
},
)
call-function: (
"check-logo",
("dark", "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"),
{
"theme": "dark",
"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) " +
"drop-shadow(rgb(255, 255, 255) 0px 1px 0px) " +
"drop-shadow(rgb(255, 255, 255) -1px 0px 0px) " +
"drop-shadow(rgb(255, 255, 255) 0px -1px 0px)",
},
)
call-function: (
"check-logo",
("light", "none"),
{
"theme": "light",
"filter": "none",
},
)

View File

@ -1,3 +1,4 @@
// ignore-tidy-linelength
// This test ensures that the items declaration content overflow is handled inside the <pre> directly.
// We need to disable this check because

View File

@ -25,6 +25,7 @@
/// displayed on the console with --example.
const ERROR_CODE_COLS: usize = 80;
const COLS: usize = 100;
const GOML_COLS: usize = 120;
const LINES: usize = 3000;
@ -230,7 +231,8 @@ fn skip(path: &Path) -> bool {
walk(path, &mut skip, &mut |entry, contents| {
let file = entry.path();
let filename = file.file_name().unwrap().to_string_lossy();
let extensions = [".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h", ".md", ".css", ".ftl"];
let extensions =
[".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h", ".md", ".css", ".ftl", ".goml"];
if extensions.iter().all(|e| !filename.ends_with(e)) || filename.starts_with(".#") {
return;
}
@ -255,8 +257,15 @@ fn skip(path: &Path) -> bool {
let extension = file.extension().unwrap().to_string_lossy();
let is_error_code = extension == "md" && is_in(file, "src", "error_codes");
let is_goml_code = extension == "goml";
let max_columns = if is_error_code { ERROR_CODE_COLS } else { COLS };
let max_columns = if is_error_code {
ERROR_CODE_COLS
} else if is_goml_code {
GOML_COLS
} else {
COLS
};
let can_contain = contents.contains("// ignore-tidy-")
|| contents.contains("# ignore-tidy-")