Search code examples
open-sourcelines-of-codecloc

How to ignore files based on suffix in cloc..?


It should be a trivial task but neither reading through the docs and man page nor googling brought up a solution to what I'm trying to achieve:

cloc is scanning our source tree and we want it to ignore all *.html and *.css files.

Is there some way to give cloc a list of file extensions to ignore..?


Solution

  • Reading the help , via cloc --help, gives:

    --exclude-ext=<ext1>[,<ext2>[...]] 
    Do not count files having the given file name extensions.
    

    I tried

    cloc <file(s)/dir(s)> --exclude-ext=html,css
    

    and it worked as expected.