Skip to content
Skills Library
Programming · Building & coding

clippy-advanced

/clippy-advanced

Advanced Clippy configuration for Rust — custom rules, pedantic/nursery lints, clippy.toml, IDE and CI integration. Use when configuring or enforcing lint standards.

Licence
MIT
Last repository change
24.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
4
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Advanced Clippy configuration for Rust — custom rules, pedantic/nursery lints, clippy.toml, IDE and CI integration. Use when configuring or enforcing lint standards.

Original author description

Advanced Clippy configuration for Rust — custom rules, pedantic/nursery lints, clippy.toml, IDE and CI integration. Use when configuring or enforcing lint standards.

How it works

  1. When to Use This Skill
  2. Installation
  3. Basic Usage
  4. Lint Categories
  5. clippy.toml Essential Settings
  6. Lint Suppression
  7. Agentic Optimizations
  8. Quick Reference
  9. References
Original SKILL.md headings · 168 lines, 640 words
SKILL.md preview
---
created: 2025-12-16
modified: 2026-05-09
reviewed: 2025-12-16
name: clippy-advanced
description: "Advanced Clippy configuration for Rust — custom rules, pedantic/nursery lints, clippy.toml, IDE and CI integration. Use when configuring or enforcing lint standards."
user-invocable: false
allowed-tools: Bash, Read, Grep, Glob
---

# clippy-advanced - Advanced Clippy Configuration

Advanced Clippy configuration for comprehensive Rust linting, including custom rules, lint categories, disallowed methods, and IDE integration.

## When to Use This Skill

| Use this skill when... | Use another tool instead when... |
|------------------------|----------------------------------|
| Configuring Clippy lint rules | Formatting code (use rustfmt) |
| Setting up CI linting for Rust | Building/compiling (use cargo build) |
| Customizing clippy.toml | Running tests (use cargo test) |
| Enforcing code standards | Managing dependencies (use cargo add) |

## Installation

```bash
# Clippy is included with rustup
rustup component add clippy

# Verify installation
cargo clippy --version

# Update clippy with rust toolchain
rustup update
```

## Basic Usage

```bash
# Run clippy on current project
cargo clippy

# Run on all targets (lib, bins, tests, examples, benches)
cargo clippy --all-targets

# Run with all features enabled
cargo clippy --all-features

# Run on workspace
cargo clippy --workspace --all-targets --all-features

# Show detailed lint explanations
cargo clippy -- -W clippy::all -A clippy::pedantic

# Treat warnings as errors
cargo clippy -- -D warnings
```

## Lint Categories

| Category | Purpose | Default |
|----------|---------|---------|
| `clippy::correctness` | Likely bugs | Deny |
| `clippy::complexity` | Overly complex code | Warn |
| `clippy::perf` | Performance issues | Warn |
| `clippy::style` | Code style | Warn |
| `clippy::suspicious` | Code that looks wrong | Warn |
| `clippy::pedantic` | Opinionated style | Off |
| `clippy::restriction` | Opt-in constraints | Off |
| `clippy::nursery` | Experimental | Off |
| `clippy::cargo` | Cargo.toml issues | Off |

### Recommended Cargo.toml Configuration

```toml
[workspace.lints.clippy]
# Deny correctness issues (likely bugs)
correctness = "deny"
complexity = "warn"
perf = "warn"
style = "warn"
suspicious = "warn"

# Enable pedantic but allow some noisy lints
pedantic = "warn"
must_use_candidate = "allow"
missing_errors_doc = "allow"

# Enable some restriction lints selectively
clone_on_ref_ptr = "warn"
dbg_macro = "warn"
print_stdout = "warn"
todo = "warn"
unimplemented = "warn"
unwrap_used = "warn"

# Enable nursery lints (experimental)
use_self = "warn"
```

## clippy.toml Essential Settings

Create `clippy.toml` in project root for thresholds and disallowed items:

```toml
cognitive-complexity-threshold = 15
too-many-lines-threshold = 100
too-many-arguments-threshold = 5

disallowed-methods = [
  { path = "std::env::var", reason = "Use std::env::var_os for better Unicode handling" },
  { path = "std::process::exit", reason = "Use Result propagation instead" },
]

disallowed-names = ["foo", "bar", "baz"]
```

## Lint Suppression

```rust
// Function-level
#[allow(clippy::too_many_arguments)]
fn complex_function(a: i32, b: i32, c: i32, d: i32, e: i32, f: i32) {}

// Module-level (src/lib.rs)
#![warn(clippy::all)]
#![warn(clippy::pedantic)]
#![deny(clippy::unwrap_used)]
#![allow(clippy::module_name_repetitions)]

// Inline
#[allow(clippy::cast_possible_truncation)]
let x = value as u8;
```

## Agentic Optimizations

| Context | Command |
|---------|---------|
| CI strict | `cargo clippy --workspace --all-targets -- -D warnings` |
| JSON output | `cargo clippy --message-format=json` |
| Compact errors | `cargo clippy --message-format=short` |
| Quick check | `cargo clippy --message-format=short -- -D warnings` |
| Pedantic check | `cargo clippy -- -W clippy::pedantic -D clippy::correctness` |

## Quick Reference

### Command-Line Flags

| Flag | Description |
|------|-------------|
| `--all-targets` | Check lib, bins, tests, examples, benches |
| `--all-features` | Enable all features |
| `--workspace` | Check entire workspace |
| `--message-format=json` | JSON output for tooling |
| `--message-format=short` | Compact error format |
| `-- -D warnings` | Treat warnings as errors |
| `-- -W clippy::pedantic` | Enable pedantic lints |
| `-- -A clippy::lint_name` | Allow specific lint |

### Lint Levels

| Level | Attribute | Effect |
|-------|-----------|--------|
| Allow | `#[allow(...)]` | Suppress lint |
| Warn | `#[warn(...)]` | Show warning |
| Deny | `#[deny(...)]` | Compile error |

## References

- [Clippy documentation](https://doc.rust-lang.org/clippy/)
- [Lint list](https://rust-lang.github.io/rust-clippy/master/)
- [Configuration options](https://doc.rust-lang.org/clippy/configuration.html)
- [rust-analyzer integration](https://rust-analyzer.github.io/manual.html)

For detailed configuration examples, CI integration, IDE setup, and best practices, see [REFERENCE.md](REFERENCE.md).
Files in this package (2)
  • REFERENCE.md 11 KB
  • SKILL.md 5 KB

Versions

The database has no other skills named clippy-advanced.

Database snapshot: 13.11.2026 · package version e2a0ce3d8e74 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100clippy-custom
    Use when developing custom Clippy lints, implementing lint passes, and contributing to Clippy for Rust code standards.
  • 100clippy-configuration
    Use when configuring Clippy for Rust projects with TOML config, lint groups, attributes, and workspace setup.
  • 95rust-idioms
    Rust idioms: ownership and borrow checker patterns, error handling with thiserror/anyhow, Tokio async concurrency, lifetime management, and Clippy pedantic compliance. Use when writing, optimizing, or reviewing Rust crates.
  • 100google-rust-style
    Google's Rust style guide for coding agents: paste-ready rustfmt.toml, clippy.toml and [lints], the judgement rules no tool checks (module layout, imports, API shape, panics, naming), and where Google overrides common Rust advice. Use when writing or reviewing Rust to Google…
  • 100rust-style-clippy
    Apply and diagnose Rust style, rustfmt, Clippy, compiler diagnostics, Edition migrations, lint policy, idiomatic control flow, error handling, allocation behavior, production Rust conventions, and the Rust API Guidelines ↔ Clippy lint mapping. Use when users ask to format or…
  • 100rust-project-setup
    Guidance for scaffolding new Rust projects. Use when: (1) starting a new Rust project or workspace, (2) configuring Cargo.toml best practices, (3) setting up CI pipelines for Rust, (4) organizing a multi-crate workspace, (5) configuring clippy, rustfmt, and linting.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.