Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo test

audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-audit
- run: cargo audit

coverage:
name: Coverage
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [1.2.3] - 2026-03-13

### Added

- Summary line now shows autocorrectable count when fixable offenses are detected:
`22 files inspected, 41 offenses detected, 21 offenses autocorrectable (run rubyfast --fix)`
- CI: `cargo audit` security check for dependency vulnerabilities

## [1.2.2] - 2026-03-11

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rubyfast"
version = "1.2.2"
version = "1.2.3"
edition = "2024"
description = "An ultra-fast Ruby performance linter rewritten in Rust — detects 19 common anti-patterns"
license = "MIT"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ app/controllers/api/v1/health_articles_controller.rb
L11 Hash#fetch with second argument is slower than Hash#fetch with block
```

Offenses that support `--fix` are tagged with `(fixable)`:
Offenses that support `--fix` are tagged with `(fixable)`, and the summary line shows how many can be auto-fixed:

```
tests/fixtures/19_for_loop.rb
L1 For loop is slower than using each (fixable)

22 files inspected, 41 offenses detected, 21 offenses autocorrectable (run rubyfast --fix)
```

### `--format rule`
Expand Down
32 changes: 29 additions & 3 deletions src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ fn print_statistics(result: &TraversalResult) {
let files = result.files_inspected;
let offenses = result.total_offenses();
let parse_errors = result.parse_errors.len();
let fixable: usize = result
.results
.iter()
.flat_map(|r| &r.offenses)
.filter(|o| o.kind.is_fixable())
.count();

let files_str = format!("{} {} inspected", files, pluralize("file", files));

Expand All @@ -134,20 +140,40 @@ fn print_statistics(result: &TraversalResult) {
offenses_str.red().to_string()
};

let fixable_hint = if fixable > 0 {
format!(
", {}",
format!(
"{} {} autocorrectable (run rubyfast --fix)",
fixable,
pluralize("offense", fixable)
)
.yellow()
)
} else {
String::new()
};

if parse_errors > 0 {
let errors_str = format!(
"{} unparsable {} found",
parse_errors,
pluralize("file", parse_errors)
);
println!(
"{}, {}, {}",
"{}, {}, {}{}",
files_str.green(),
colored_offenses,
errors_str.red()
errors_str.red(),
fixable_hint
);
} else {
println!("{}, {}", files_str.green(), colored_offenses);
println!(
"{}, {}{}",
files_str.green(),
colored_offenses,
fixable_hint
);
}
}

Expand Down
Loading