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/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/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` 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!();