Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename clippy-preview to clippy and stabilize it #7382

Closed
wants to merge 3 commits into from
Closed
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
9 changes: 1 addition & 8 deletions src/bin/cargo/commands/clippy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cargo::ops;
use cargo::util;

pub fn cli() -> App {
subcommand("clippy-preview")
subcommand("clippy")
.about("Checks a package to catch common mistakes and improve your Rust code.")
.arg(Arg::with_name("args").multiple(true))
.arg_package_spec(
Expand Down Expand Up @@ -63,13 +63,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
let mode = CompileMode::Check { test: false };
let mut compile_opts = args.compile_options(config, mode, Some(&ws))?;

if !config.cli_unstable().unstable_options {
return Err(failure::format_err!(
"`clippy-preview` is unstable, pass `-Z unstable-options` to enable it"
)
.into());
}

let mut wrapper = util::process(util::config::clippy_driver());

if let Some(clippy_args) = args.values_of("args") {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn builtin_exec(cmd: &str) -> Option<fn(&mut Config, &ArgMatches<'_>) -> Cli
"build" => build::exec,
"check" => check::exec,
"clean" => clean::exec,
"clippy-preview" => clippy::exec,
"clippy" => clippy::exec,
"doc" => doc::exec,
"fetch" => fetch::exec,
"fix" => fix::exec,
Expand Down
96 changes: 96 additions & 0 deletions src/doc/man/cargo-clippy.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
= cargo-clippy(1)
:idprefix: cargo_clippy_
:doctype: manpage
:actionverb: Clippy

== NAME

cargo-clippy - Check the current package with clippy

== SYNOPSIS

`cargo clippy [_OPTIONS_]`

== DESCRIPTION

Check a local package and all of its local dependencies for common mistakes
with clippy.

== OPTIONS

yaahc marked this conversation as resolved.
Show resolved Hide resolved
To allow or deny a lint from the command line you can use `cargo clippy --`
with:

-W --warn OPT Set lint warnings
-A --allow OPT Set lint allowed
-D --deny OPT Set lint denied
-F --forbid OPT Set lint forbidden

You can use tool lints to allow or deny lints from your code, eg.:

#[allow(clippy::needless_lifetimes)]

=== Package Selection

include::options-packages.adoc[]

=== Target Selection

When no target selection options are given, `cargo clippy` will check all
binary and library targets of the selected packages. Binaries are skipped if
they have `required-features` that are missing.

include::options-targets.adoc[]

include::options-features.adoc[]

=== Compilation Options

include::options-target-triple.adoc[]

include::options-release.adoc[]

include::options-profile.adoc[]

=== Output Options

include::options-target-dir.adoc[]

=== Display Options

include::options-display.adoc[]

include::options-message-format.adoc[]

=== Manifest Options

include::options-manifest-path.adoc[]

include::options-locked.adoc[]

=== Common Options

include::options-common.adoc[]

=== Miscellaneous Options

include::options-jobs.adoc[]

include::section-profiles.adoc[]

include::section-environment.adoc[]

include::section-exit-status.adoc[]

== EXAMPLES

. Check the local package for common mistakes:

cargo clippy

. Check all targets, including unit tests:

cargo clippy --all-targets --profile=test

== SEE ALSO
man:cargo[1], man:cargo-build[1], man:cargo-check[1]
Loading