Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

cargo-count doesn't find any code #36

Open
ghost opened this issue Jun 23, 2017 · 6 comments
Open

cargo-count doesn't find any code #36

ghost opened this issue Jun 23, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 23, 2017

I cannot get cargo-count to find any code. I have tried it in both Rust and C++ repositories, and it always outputs "No source files were found matching the specified criteria". Example:

bram@falafel% mkdir testrepo
bram@falafel% cd testrepo
bram@falafel% cargo init --bin
     Created binary (application) project
bram@falafel% cat src/main.rs
fn main() {
    println!("Hello, world!");
}
bram@falafel% cargo count
Gathering information...

	No source files were found matching the specified criteria

Edit: additional info:

bram@falafel% cargo count -v
Gathering information...
Excluding: ["/home/bram/tmp/testrepo/.git"]
Displaying the results:

	No source files were found matching the specified criteria
bram@falafel% cargo count -V
cargo-count v0.2.2

I installed cargo-count from crates.io.

@ghost
Copy link
Author

ghost commented Jul 5, 2017

This is fixed for me by #37, which I find a bit strange, since I have no idea why the version mismatch between Cargo.toml and Cargo.lock would result in this behavior.

This is my first ever PR so I hope I did it right! (Even though this is pretty much the smallest PR possible...)

@mthebridge
Copy link

I have the same issue - but I can workaround it, because if I run cargo count -a --exclude=$(cat .gitignore) everything works as expected. Which suggests it's the gitignore handling that's broken...?

@repi
Copy link

repi commented Jan 9, 2018

Same problem here, on both Mac and Windows with my repo. cargo count -a --exclude=$(cat .gitignore) worked around it

@Aeledfyr
Copy link

Until the author makes a new version on crates.io, you can fix this by cloning the repo and building and installing it yourself.

Here is a quick script to do that: git clone https://github.com/kbknapp/cargo-count && cd cargo-count && cargo install --path . --force

@repi
Copy link

repi commented May 24, 2019

Can confirm that installing the latest git version solved the issue I was running into

@lucidBrot
Copy link

Installing the latest git version with @Aeledfyr 's suggested command did install the new version but did not fix the issue for me in the root of my project workspace. However, it does now work for each individual crate, which it did not before.

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

4 participants