Expand description
§swizzy
A fast, developer-friendly SwiftLint output formatter that groups issues by file and provides clickable file paths for editor integration.
§Features
- Grouped Output: Issues are organized by file for better readability
- Editor Integration: File paths with line numbers are clickable in most editors/IDEs
- Smart Colors: Automatically disables colors when output is redirected
- Zero Configuration: Works out of the box with SwiftLint JSON output
- Fast Performance: Built with Rust for maximum speed
- Flexible Input: Accepts piped input or runs SwiftLint directly
§Usage
# Pipe SwiftLint JSON output to swizzy
swiftlint lint --reporter json | swizzy
# Run from a directory containing Swift source files
swizzy§Exit Codes
0: No issues found or successfully processed1: Issues were found and reported
§Library Usage
While swizzy is primarily a command-line tool, its core functionality is available as a library for integration into other Rust applications:
use swizzy::{parse_swiftlint_output, group_issues_by_file, format_issues_output};
let json_input = r#"[{"file": "test.swift", "line": 1, "severity": "warning", "reason": "Test issue", "rule_id": null}]"#;
let issues = parse_swiftlint_output(json_input).unwrap();
let grouped = group_issues_by_file(issues);
let (formatted, count) = format_issues_output(grouped, false);
println!("{}", formatted);Structs§
- Swiftlint
Issue - Represents a single SwiftLint issue parsed from JSON output.
Functions§
- format_
issue - Formats a single SwiftLint issue for display.
- format_
issues_ output - Formats all grouped SwiftLint issues for display.
- group_
issues_ by_ file - Groups SwiftLint issues by their file path.
- parse_
swiftlint_ output - Parses SwiftLint JSON output into a vector of issues.