counting files with no extension
Brought to you by:
alnd
Hello,
In projects in our company, we have files without extensions, and without shebang. Currently there is no possibility in cloc to manage this type of files... I create simple patch preview, it adds new option: --lang-no-ext, then we can customize how cloc have to recognize files without extensions. Now if I use cloc like this:
cloc --lang-no-ext=perl some_project
cloc correctly recognize files with no extension as per files, and generate statistics for them :)
Anonymous
lang-no-ext patch
Thanks for your suggestion and patch. I'll add this in the next version.
The --lang-no-ext option was implemented in svn checkin 198.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Thanks, alnd :)
Feature appeared in release 1.53.
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
I have a bunch of files with no ext. They are modules for different languages, none of which have a #! at the start of the script/config file. with names like rbn-reboot-rpsw1, profile.ssrsim... All I want to do is either a code count or a diff between to files all of them text. Does cloc have a feture where i can just try to do a basic code count or a basic diff without having to hack/modify the code or cloc-arguments?
Posting on a closed patch ticket is going to make it difficult for you to track progress on this...
Yes, cloc can do what you want with the --force-lang option where you tell cloc which language counter to use on your file(s). Otherwise, without a #! or file extension, cloc has almost nothing to go on to determine the language counter to use for a file. Another possible solution is to make copies of your files with names that have extensions then count those.
I will leave this ticket in a pending state for a week then close it again. For future reference, post issues to github: https://github.com/AlDanial/cloc/issues