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

loc doesn't respect directories ignored by .gitignore #58

Closed
cptroot opened this issue Aug 2, 2017 · 2 comments
Closed

loc doesn't respect directories ignored by .gitignore #58

cptroot opened this issue Aug 2, 2017 · 2 comments

Comments

@cptroot
Copy link

cptroot commented Aug 2, 2017

Bug found with version 0.3.4 of loc.
When I run loc on a directory like the one that follows, loc doesn't ignore directories ignored by gitignore. This is odd to me because ripgrep currently has the correct behavior.

Given the following directory:

loc-gitignore $ tree .
.
├── hello_rust.rs
├── ignored
│   └── hello_rust.rs
├── ignored2
│   └── hello_rust.rs
└── unignored
    └── hello_rust.rs

3 directories, 4 files

And the following .gitignore file:

loc-gitignore $ more .gitignore
ignored/
ignored2

loc gives the following results:

loc-gitignore $ loc
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Rust                     4           12            0            0           12
--------------------------------------------------------------------------------
 Total                    4           12            0            0           12
--------------------------------------------------------------------------------
loc-gitignore $ 

Where rg ignores the folders correctly:

loc-gitignore $ rg a
hello_rust.rs
1:fn main() {

unignored/hello_rust.rs
1:fn main() {
@cgag
Copy link
Owner

cgag commented Aug 3, 2017

fixed in master but i haven't done a release in a while, i should do that

@caemor
Copy link

caemor commented Oct 5, 2017

yes a new release with the fixed behaviour would be great :-)

@cgag cgag closed this as completed Oct 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants