-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
Add option to filter out links #227
Comments
@XAMPPRocky How difficult would this be to implement? Without having looked at tokei (aside from adding PostCSS), my initial thought would be to use a I'd be interested in doing this if it's not too hard to jump into. |
@jhpratt Hey, I don't about about the second option, however the first option should be easy to add. Tokei's CLI is set using For traversing the file system tokei uses |
Looks like there's the Looking through tokei's code, I presume |
@jhpratt Yes sorry I should have pointed you to that. I believe that is what Everything before If you have any other questions please feel free to ask. |
Looking through various documentation, looks like symlinks are currently ignored, and a trivial check shows this is the case. What would be the preferred way to handle hard links? If it were up to me, I'd lean towards automatically excluding anything past the first, as you'd essentially be counting the file twice. Thanks for the explanation, by the way! Responsiveness is quite helpful 🙂 Edit: Turns out it's nearly trivial to exclude a file the second time around. Using |
Today I found out that tokei's reported lines of code for my repository seemed to explode.
The reason for this was that tokei (incorrectly) counted links (symbolic-links and hard-links) as if they were regular files.
I think it would be the best to make tokei completely ignore symbolic links and ignore all multiple occurrences of the same hard linked file.
While restating defaults might be hard, it should be also okay to add options to filter links out of the accumulation process.
I think options like
--ignore-symbolic-links
: Ignores any symbolic link.--ignore-multiple-hard-links
: Ignores all but one occurences of a hard linked file that has its source within the given search space (repository for example) and ignore all hard linked files that have their source outside of the search space.The text was updated successfully, but these errors were encountered: