{"id":13566239,"url":"https://github.com/ericseppanen/cargo-cranky","last_synced_at":"2025-04-03T23:31:24.659Z","repository":{"id":43533335,"uuid":"511276143","full_name":"ericseppanen/cargo-cranky","owner":"ericseppanen","description":"An easy to configure wrapper for Rust's clippy","archived":false,"fork":false,"pushed_at":"2023-03-05T19:57:28.000Z","size":22,"stargazers_count":107,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T20:46:20.417Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericseppanen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-06T20:02:21.000Z","updated_at":"2024-11-29T12:56:24.000Z","dependencies_parsed_at":"2024-01-19T07:10:22.345Z","dependency_job_id":"7bed778c-7538-4b1e-b0ee-2082346b09d3","html_url":"https://github.com/ericseppanen/cargo-cranky","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":"0.045454545454545414","last_synced_commit":"1bc1d2b27e8cb9eb75d5ad44ce1dc2886f67a310"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericseppanen%2Fcargo-cranky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericseppanen%2Fcargo-cranky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericseppanen%2Fcargo-cranky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericseppanen%2Fcargo-cranky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericseppanen","download_url":"https://codeload.github.com/ericseppanen/cargo-cranky/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097862,"owners_count":20883125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:05.185Z","updated_at":"2025-04-03T23:31:22.060Z","avatar_url":"https://github.com/ericseppanen.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# cargo-cranky\n\nI wish that I could check in a file that would specify Rust lints for my entire Cargo workspace, and have that be applied to all the crates, libraries, binaries, and examples.\n\nDoing this with just Rust/Cargo/Clippy can be a bit of a pain. `cargo-cranky` makes it a little easier!\n\n`cargo-cranky` is just a wrapper around `cargo clippy`; it examines your `Cranky.toml` config file, and constructs the necessary `cargo clippy` command line. Most arguments are passed through to clippy, so it should work from every context where clippy works (IDEs, CI scripts, etc).\n\nFor example, if `Cranky.toml` contains this:\n\n```toml\nwarn = [\n  \"clippy::empty_structs_with_brackets\",\n  \"clippy::cast_possible_truncation\",\n]\n```\n\nand I run `cargo cranky`, I get those extra lints:\n```txt\nwarning: found empty brackets on struct declaration\n  --\u003e src/main.rs:11:12\n   |\n11 | struct Unit {}\n   |            ^^^\n```\n\n```txt\nwarning: casting `u64` to `u8` may truncate the value\n  --\u003e src/main.rs:23:9\n   |\n23 |         x as u8\n```\n\nThis is exactly the same as manually running `cargo clippy` with the extra parameters `--warn clippy::empty_structs_with_brackets` and `--warn clippy::cast_possible_truncation`.\n\nYou may find some useful clippy lints for your project in the [clippy documentation][clippy-docs]. I recommend browsing the \"pedantic\" and \"restriction\" groups.\n\n### Installing\n\n`cargo install cargo-cranky`\n\n### Configuring\n\nCreate a file called `Cranky.toml` at the top of your project tree. The file can contain keys `allow`, `warn`, or `deny` that contain an array of clippy lint names.\n\nExample:\n```toml\ndeny = [\n  # My crate should never need unsafe code.\n  \"unsafe_code\",\n]\n\nwarn = [\n  \"clippy::empty_structs_with_brackets\",\n  \"clippy::cast_possible_truncation\",\n]\n\nallow = [\n  \"clippy::double_comparisons\",\n]\n```\n\nNote: in the case of overlap, `allow` will always override `warn`, which in turn will always override `deny`. The order of these fields in `Cranky.toml` has no effect.\n\n### FAQ\n\n**Can I specify non-clippy lints?**\n\nYes! Try for example `unsafe_code` or `missing_docs`.\n\nNote: Clippy lints should be specified using the long syntax, e.g. `clippy::some_lint_name`. Clippy will issue a warning if the prefix is missing.\n\n**Does it work with vscode?**\n\nYes! Just type `cranky` into the \"Check On Save: Command\" setting, or drop this into `settings.json`:\n```txt\n{\n    \"rust-analyzer.check.command\": \"cranky\"\n}\n```\n\nSet it back to \"check\" (or \"clippy\") to return to the previous behavior.\n\n**Is this reckless or non-idiomatic?**\n\nThat depends on how you use it. If your goal is to enforce a non-idiomatic coding style, that's probably not a great idea.\n\nIf you want to suppress lints that are enabled by default, it's probably better to do that using the `#[allow(clippy::some_lint)]` syntax in the source file, since that gives you a chance to add a comment explaining your reasoning.\n\nThe main goal of this tool is to make it easier to enable additional clippy lints, that improve code maintainability or safety (i.e. `clippy::cast_possible_truncation`).\n\n**I have ~~complaints~~ suggestions!**\n\nPlease [file a GitHub issue][github-issue] if you have ideas that could make this tool better.\n\n\n[github-issue]: https://github.com/ericseppanen/cargo-cranky/issues\n[clippy]: https://github.com/rust-lang/rust-clippy#readme\n[clippy-docs]: https://rust-lang.github.io/rust-clippy/stable/index.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericseppanen%2Fcargo-cranky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericseppanen%2Fcargo-cranky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericseppanen%2Fcargo-cranky/lists"}