Comments (9)
Hi,
I was playing around with the code trying to fix this. I thought I'll just note down my observations:
- This problem actually originates at gitignore.rs repo. I've raised a bug for this case.
- Ideally shouldn't the
get_all_files
fn begitignore.get_included_files().filter(|fp| !exclude.contains(fp))
. The only thing would be it might not honorfollow_links
- I was wondering what's the point of having the
follow_links
options? It looks like the current code wouldn't handle circular links (upstream gitignore wouldn't either). Also symlinks might point outside the current git directory in which case does it make sense to follow it? And if a file is in the repo but is a symlink won't it get included by the non-symlinked path?
Just my $0.02. Please tell me what you think
from cargo-count.
In that case I can send a pull request to remove this option and replace get_all_files which uses gitignore.get_included_files. Should I go ahead and do that?
from cargo-count.
Any updates on this?
from cargo-count.
@nabijaczleweli Sorry not yet, I've been spending my limited spare time on clap. I'm hoping to get some of this looked at early next week.
from cargo-count.
I was wondering what's the point of having the follow_links options?
I can't remember why I originally added it, but it wasn't really meant to do anything too sophisticated like detecting circular links. In all honesty we could probably remove that options and still be fine.
from cargo-count.
@rabisg I apologize, I've had other projects and my day job take priority here. I'd be more than happy to take a PR on this.
from cargo-count.
Seems to be a problem with the .gitignore
handling. With an empty crate generated with cargo new
, it says there isn't "any file matching the criteria". If I remove the .gitignore
, it outputs the line counts as expected.
from cargo-count.
Just a heads up. My PR got merged in nathankleyn/gitignore.rs#12 and v1.0.6 was released. Since I cannot devote time to this right now if someone wants to update this repo I'll be happy to help
from cargo-count.
@kbknapp All you should need to do right now to fix this would be to either update the Cargo.toml to have 1.0.6 as the min version for gitignore, or just to remove the Cargo.lock and rebuild. Then you would only need to release a new version to crates.io, and it would work. Even just cloning the repo works right now, just not the version on crates.io.
from cargo-count.
Related Issues (18)
- C and C Headers have some unsafe code HOT 8
- cpp is not the only extension for C++ HOT 7
- Block comment bug HOT 1
- Unused import std::io::Write HOT 1
- error: stream did not contain valid UTF-8 HOT 1
- cargo-count doesn't find any code HOT 6
- Incorrect number of "unsafe" instances reported
- Add more languages HOT 1
- unable to install HOT 4
- Numerous warnings when building cargo-count
- Looking for maintainers?
- Add support of GLSL
- Ensure "unsafe" counts HOT 4
- cargo count dies if there are broken symlinks in tree HOT 2
- cago count will fail if a symlink points to a parent directory HOT 2
- cargo count counts rust source files in the target/ directory HOT 2
- Add option to use .gitignore as baseline for --exclude
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-count.