Last 12 weeks · 0 commits
2 of 6 standards met
Closes #507 Summary The default ANSI palette is difficult to read in legacy Windows PowerShell/conhost sessions with the default dark-blue background. This centralizes Hyperfine's semantic colors and selects a readable palette only when reports that background. Other terminals keep the existing colors. The regression tests cover the palette selection and ensure that only a dark-blue background selects the legacy theme. Tests On Windows (Git Bash), all passed: — 45 unit tests, 19 execution-order tests, and 35 integration tests passed; 0 failed — passed; only existing repository warnings remain — passed; only the existing naming warning remains Baseline limitation The host is accessed through non-interactive SSH, so the blue-console contrast cannot be visually rendered here. The unmodified default branch was reproduced at the ANSI-output level: forced-color output emitted the low-contrast green (), blue (), and magenta () sequences described by the issue. The new behavior is selected from the actual Windows console buffer attributes and is covered by deterministic Windows tests. AI assistance This PR was authored with AI assistance for issue triage, repository navigation, implementation, test authoring, and validation. The change and test results are stated explicitly above.
Problem When exporting benchmark results to CSV, hyperfine writes the command string and parameter values verbatim into CSV cells. Spreadsheet applications (Excel, LibreOffice Calc, Google Sheets) interpret cells beginning with , , , , tab, or carriage return as formulas, which can lead to formula injection (CWE-1236) when parameter values come from external input. For example, exported to CSV contains the literal, unescaped text , which is evaluated as a live formula when the file is opened in a spreadsheet. Fix Add a helper that prefixes values beginning with formula-triggering characters with a single quote (), forcing spreadsheet applications to display them as literal text. The helper is applied to both the field and all columns. This is the standard mitigation for CWE-1236 and does not affect values that don't begin with dangerous characters. Numeric fields (mean, stddev, etc.) are unaffected since they are serialized from values which cannot produce formula-interpretable strings. Testing Added two new tests: : Integration test that verifies a parameter value of is properly escaped in the CSV output as . : Unit test covering all six dangerous prefixes (, , , , , ) and several safe values that should pass through unchanged. All existing tests pass (3 unit + 39 integration).
What Two typos in : 1. → (lines 312, 314) — is not a valid nroff/troff font escape. Italic is (uppercase ). Every other italic span in the file already uses (, , , …). The two occurrences in the option description would render as literal text instead of an italic word. 2. → in SYNOPSIS (line 38) — minor consistency fix. Every other hyphenated long option in the SYNOPSIS block escapes its internal hyphens (, , , etc.). had an unescaped second hyphen. Diff No functional or behavioural change — documentation only.
Repository: sharkdp/hyperfine. Description: A command-line benchmarking tool Stars: 28892, Forks: 511. Primary language: Rust. Languages: Rust (93%), Python (7%). License: Apache-2.0. Topics: benchmark, cli, command-line, rust, terminal, tool. Latest release: v1.20.0 (10mo ago). Open PRs: 45, open issues: 55. Last activity: 4mo ago. Community health: 42%. Top contributors: sharkdp, dependabot[bot], dependabot-preview[bot], dependabot-support, stevepentland, berombau, ZephyrDRH, ppaulweber, jasonpeacock, scampi and others.