https://github.com/tankosinn/clipped
✂️ Clipped your cargo clippy
https://github.com/tankosinn/clipped
cli clippy git-hooks lint precommit
Last synced: 6 months ago
JSON representation
✂️ Clipped your cargo clippy
- Host: GitHub
- URL: https://github.com/tankosinn/clipped
- Owner: tankosinn
- License: mit
- Created: 2025-07-07T10:40:01.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-07-07T13:17:03.000Z (6 months ago)
- Last Synced: 2025-07-07T13:40:49.159Z (6 months ago)
- Topics: cli, clippy, git-hooks, lint, precommit
- Language: Rust
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ✂️ Clipped
Clipped is a workspace-aware, file-scoped `cargo clippy` wrapper that filters diagnostics.
## ✨ Features
- 📁 **File-based filtering**: See only diagnostics for files you specify
- 🚀 **Workspace-aware**: Automatically runs only on relevant workspace packages
- 🎯 **Level filtering**: Control diagnostic severity (note, help, warning, error)
- ⚙️ **Flexible configuration**: CLI, env vars, or config file
- 🔧 **Clippy pass-through**: Forward any arguments to Clippy
## 📦 Installation
```bash
cargo install clipped
```
## 🛠 Usage
```bash
# Run on entire project (same as `cargo clippy`)
clipped
# Run on specific files
clipped src/main.rs src/lib.rs
# Show only errors
clipped --level error src/main.rs
# Pass args to Clippy
clipped src/main.rs -- -- -W clippy::all
```
## ⚙️ Configuration
Configure via `.clipped.toml`:
```toml
level = "error"
clippy_args = ["-W", "clippy::pedantic"]
```
Or set environment variables:
```bash
export CLIPPED_LEVEL=error
export CLIPPED_CLIPPY_ARGS='["--", "-W", "clippy::all"]' # as JSON array
```
## 🤖 CLI
```bash
clipped [OPTIONS] [FILES]... [-- ...]
```
### Options
- `--config ` - Path to the config file (default: `.clipped.toml`)
- `--level ` - Set the level: `note`, `help`, `warning`, `error` (default: `warning`)
- `-v`, `--verbose` - Enable verbose output
- `-h`, `--help` - Print help
- `-V`, `--version` - Print version
## 🪝 Git Hooks
Clipped is designed to integrate seamlessly with Git hooks.
With `pre-commit`:
```yaml
repos:
- repo: local
hooks:
- id: clipped
name: clipped
entry: clipped
language: system
args: [...]
pass_filenames: true
require_serial: true
```
or use the `clipped` repository:
```yaml
repos:
- repo: https://github.com/tankosinn/clipped
rev: 0.1.0
hooks:
- id: clipped
```
## 📝 License
[MIT License](https://github.com/tankosinn/clipped/blob/main/LICENSE)