From 4c2b455899576cc240567d7a7c943c36e866d543 Mon Sep 17 00:00:00 2001 From: Zac <579103+7a6163@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:54:34 +0800 Subject: [PATCH 1/2] feat: show human-readable explanation in default file format output The default --format file output previously only showed the config_key (e.g. fetch_with_argument_vs_block), which was unclear to users. Now it shows the full explanation with the config key in brackets for reference: L73 Hash#fetch with second argument is slower than Hash#fetch with block [fetch_with_argument_vs_block] Bump version to 1.2.0. --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/output.rs | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad7248b..845aa26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "rubyfast" -version = "1.1.1" +version = "1.2.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 379ac62..57fce00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rubyfast" -version = "1.1.1" +version = "1.2.0" edition = "2021" description = "A Ruby performance linter rewritten in Rust — detects 19 common anti-patterns, ~100x faster than the original fasterer gem" license = "MIT" diff --git a/src/output.rs b/src/output.rs index 2d3958f..86ecddc 100644 --- a/src/output.rs +++ b/src/output.rs @@ -26,8 +26,8 @@ pub fn print_results(result: &TraversalResult, format: &OutputFormat) { /// /// ```text /// app/controllers/concerns/lottery_common.rb -/// L13 fetch_with_argument_vs_block -/// L94 fetch_with_argument_vs_block +/// L13 Hash#fetch with second argument is slower than Hash#fetch with block [fetch_with_argument_vs_block] +/// L94 Hash#fetch with second argument is slower than Hash#fetch with block [fetch_with_argument_vs_block] /// ``` fn print_results_by_file(result: &TraversalResult) { for analysis in &result.results { @@ -37,9 +37,10 @@ fn print_results_by_file(result: &TraversalResult) { println!("{}", analysis.path.bold()); for offense in &analysis.offenses { println!( - " {} {}", + " {} {} [{}]", format!("L{}", offense.line).cyan(), - offense.kind.config_key() + offense.kind.explanation(), + offense.kind.config_key().dimmed() ); } println!(); From 74a1eebd21aad9b7e58114d2a732d2b75c1f994b Mon Sep 17 00:00:00 2001 From: Zac <579103+7a6163@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:55:23 +0800 Subject: [PATCH 2/2] docs: update CHANGELOG and README for v1.2.0 Add v1.2.0 changelog entry covering improved output format, HashSet performance fix, test coverage increase, and CI upgrades. Update README output examples to match new format. --- CHANGELOG.md | 13 +++++++++++++ README.md | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d9cc65..366fb59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [1.2.0] - 2026-03-11 + +### Changed + +- Default `--format file` output now shows human-readable explanation with config key in brackets: + `L73 Hash#fetch with second argument is slower than Hash#fetch with block [fetch_with_argument_vs_block]` +- Performance: use `HashSet` instead of `Vec` for file exclusion lookup (O(1) vs O(n)) + +### Internal + +- Test coverage increased from 61.87% to 93.10% (242 tests) +- Upgrade GitHub Actions to Node.js 24 compatible versions (checkout@v6, upload-artifact@v7, download-artifact@v8) + ## [1.1.1] - 2026-03-11 ### Changed diff --git a/README.md b/README.md index e59f7f3..358479a 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,11 @@ Groups offenses by file path — compact and easy to scan: ``` app/controllers/concerns/lottery_common.rb - L13 fetch_with_argument_vs_block - L94 fetch_with_argument_vs_block + L13 Hash#fetch with second argument is slower than Hash#fetch with block [fetch_with_argument_vs_block] + L94 Hash#fetch with second argument is slower than Hash#fetch with block [fetch_with_argument_vs_block] app/controllers/api/v1/health_articles_controller.rb - L11 fetch_with_argument_vs_block + L11 Hash#fetch with second argument is slower than Hash#fetch with block [fetch_with_argument_vs_block] ``` ### `--format rule`