Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Add clippy #16

Open
phifty opened this issue Jan 1, 2016 · 6 comments
Open

Add clippy #16

phifty opened this issue Jan 1, 2016 · 6 comments

Comments

@phifty
Copy link

phifty commented Jan 1, 2016

In order to improve the code, clippy could help to remove some code smells.

@coopernurse
Copy link
Contributor

Good idea. Looking at: https://github.com/Manishearth/rust-clippy#usage Is it as simple as adding this to Cargo.toml?

[dependencies]
clippy = "*"

@phifty
Copy link
Author

phifty commented Jan 2, 2016

Give it a try :-)

@coopernurse
Copy link
Contributor

I tried it, but get a compilation error. I didn't see an obvious solution in the rust-clippy Github project. Any ideas?

james ~/src/rust-delix $ cargo test
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling clippy v0.0.35
/home/james/.cargo/registry/src/github.com-0a35038f75765ae4/clippy-0.0.35/src/lib.rs:1:1: 1:42 error: #[feature] may not be used on the stable release channel
/home/james/.cargo/registry/src/github.com-0a35038f75765ae4/clippy-0.0.35/src/lib.rs:1 #![feature(plugin_registrar, box_syntax)]
                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/james/.cargo/registry/src/github.com-0a35038f75765ae4/clippy-0.0.35/src/lib.rs:2:1: 2:40 error: #[feature] may not be used on the stable release channel
/home/james/.cargo/registry/src/github.com-0a35038f75765ae4/clippy-0.0.35/src/lib.rs:2 #![feature(rustc_private, collections)]
                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/james/.cargo/registry/src/github.com-0a35038f75765ae4/clippy-0.0.35/src/lib.rs:3:1: 3:40 error: #[feature] may not be used on the stable release channel
/home/james/.cargo/registry/src/github.com-0a35038f75765ae4/clippy-0.0.35/src/lib.rs:3 #![feature(num_bits_bytes, iter_arith)]

@phifty phifty modified the milestone: First version 0.1.0 Jan 3, 2016
@coopernurse
Copy link
Contributor

I missed this in the "Usage" section:

"Compiler plugins are highly unstable and will only work with a nightly Rust for now."

Perhaps we wait until some of the features it relies on are in a stable Rust release?

@phifty
Copy link
Author

phifty commented Jan 4, 2016

I guess it's better to wait. I'm currently using Rust 1.5.0 stable and it seems not reasonable to switch to nightly just for clippy. Let's keep this issue open, but may move it to the next milestone if clippy doesn't get stable.

@phifty phifty modified the milestones: First version 0.1.0, Second version 0.2.0 Jan 26, 2016
@phifty phifty modified the milestones: Second version 0.2.0, Third version 0.3.0 Feb 5, 2016
@phifty
Copy link
Author

phifty commented Feb 20, 2016

Since clippy not gonna be available for the stable branch any time soon, it might make sense to add clippy in a way that it only runs, if delix is compiled with a nightly rust. The output from travis ci could be used than to get some lints.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants