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

Add the ability to exclude test code/custom blocks #1068

Open
jwodder opened this issue Feb 9, 2024 · 0 comments
Open

Add the ability to exclude test code/custom blocks #1068

jwodder opened this issue Feb 9, 2024 · 0 comments

Comments

@jwodder
Copy link

jwodder commented Feb 9, 2024

I am of the opinion that test code in source files (e.g., in Rust, code in #[cfg(test)] blocks) should not count towards a project's LOC, but tokei doesn't seem to support excluding such code from its counts. I therefore request a feature like one of the following:

  • An option for explicitly excluding test code (using built-in per-language rules) from the final count

  • An option/options for excluding line ranges from consideration using regexes, e.g., --exclude-line-start "^#\[cfg\(test\)\]" --exclude-line-end "^\}"

Related issue: #948 (Seems to be more about adding a separate count for test code)

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

1 participant