{"record":{"id":"369c687d143c3b07","repo":"vectordotdev/vector","slug":"style-checks-failed","errorCode":null,"errorMessage":"style checks failed","messagePattern":"style checks failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/style.rs","lineNumber":93,"sourceCode":"        }\n        if issues.crlf {\n            println!(\"File \\\"{file}\\\" contains CRLF line breaks instead of LF line breaks\");\n            failed = true;\n        }\n        if !issues.trailing_spaces.is_empty() {\n            let lines = issues\n                .trailing_spaces\n                .iter()\n                .map(usize::to_string)\n                .collect::<Vec<_>>()\n                .join(\", \");\n            println!(\"File \\\"{file}\\\" contains trailing spaces on line(s): {lines}\");\n            failed = true;\n        }\n    }\n\n    if failed {\n        bail!(\"style checks failed\");\n    }\n\n    Ok(())\n}\n\nfn eligible_files(files: Vec<String>) -> Vec<String> {\n    files\n        .into_iter()\n        .filter(|file| {\n            !IGNORED_PATHS.iter().any(|pattern| pattern.matches(file))\n                && fs::symlink_metadata(file).is_ok_and(|metadata| metadata.file_type().is_file())\n        })\n        .collect()\n}\n\nfn inspect(contents: &[u8]) -> Issues {\n    let mut issues = Issues {\n        missing_newline: !contents.is_empty() && !contents.ends_with(b\"\\n\"),","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/style.rs#L75-L111","documentation":"`style::check` scans eligible files for style violations such as trailing whitespace; if any file failed, it sets `failed = true`, prints per-file diagnostics first, and then bails with the summary message \"style checks failed\". It is the enforcement point of `vdev check style` used in CI.","triggerScenarios":"Running `vdev check style` (or check_all which calls it) when one or more tracked files contain trailing spaces on any line; the offending files and line numbers are printed before the bail.","commonSituations":"Committing code edited in an editor without strip-trailing-whitespace, pasting terminal output or diff text into markdown files, or generating files in a script that appends spaces.","solutions":["Fix the files/lines listed in the output above the error (remove trailing spaces).","Run an automated cleanup, e.g. `sed -i 's/[[:space:]]*$//' <files>` or your editor's 'trim trailing whitespace' action.","Enable strip-trailing-whitespace-on-save in your editor to prevent recurrence.","Re-run `vdev check style` to confirm it passes."],"exampleFix":"// before: docs/example.md line 42 ends with two spaces\nSee the docs.  \n// after\nSee the docs.\n// or bulk-fix\n$ sed -i 's/[[:space:]]*$//' docs/example.md","handlingStrategy":"validation","validationCode":"# strip trailing whitespace from all tracked files before running the check\ngit ls-files -z | xargs -0 sed -i 's/[[:space:]]*$//'","typeGuard":null,"tryCatchPattern":"if let Err(e) = style_check() {\n    if e.to_string() == \"style checks failed\" {\n        eprintln!(\"see the listed files/lines above; trim trailing spaces and re-run\");\n    }\n}","preventionTips":["Enable trim-trailing-whitespace-on-save in your editor.","Add a pre-commit hook that strips trailing spaces.","Run `vdev check style` locally before pushing.","Avoid pasting raw terminal/diff output into docs without cleanup."],"tags":["style","whitespace","lint","ci"],"backgroundTag":"schema-validation-failed","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}