Menu

#1 counting files with no extension

Unstable_(example)
pending
nobody
None
5
2023-04-06
2010-10-18
MySZ
No

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 :)

Discussion

  • MySZ

    MySZ - 2010-10-18

    lang-no-ext patch

     
  • Al Danial

    Al Danial - 2010-10-22

    Thanks for your suggestion and patch. I'll add this in the next version.

     
  • Al Danial

    Al Danial - 2010-10-30

    The --lang-no-ext option was implemented in svn checkin 198.

     
  • SourceForge Robot

    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).

     
  • MySZ

    MySZ - 2010-11-16

    Thanks, alnd :)

     
  • Al Danial

    Al Danial - 2011-02-13

    Feature appeared in release 1.53.

     
  • Anonymous

    Anonymous - 2015-10-13

    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?

     
  • Al Danial

    Al Danial - 2015-10-14

    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

     
    • Anonymous

      Anonymous - 2023-04-06
      Post awaiting moderation.
  • Al Danial

    Al Danial - 2015-10-14
    • status: closed --> pending
     

Anonymous
Anonymous

Add attachments
Cancel