How can i tell CLOC tool to consider any line in a file which contains less
than 2 characters as a blank line. We have a requirement for it, how can i do
it?
For example, if \"XY\" is the only word in the line then cloc tool should
consier that line as blank line.
There currently isn't a way to do that. At best you could define a two
character word as a comment line, but not a blank line. If you have a version
of Perl installed on your machine you could do it in three steps:
make a copy of your source files
use Perl to change lines that have two character words into blank lines
using, for example,
perl -pi -e "s/^\s\w{2}\s$//" file(s)
count the resulting files with cloc
Since step 2 modifies your original files you'll want to run that step on the
copy.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
How can i tell CLOC tool to consider any line in a file which contains less
than 2 characters as a blank line. We have a requirement for it, how can i do
it?
For example, if \"XY\" is the only word in the line then cloc tool should
consier that line as blank line.
C#
filter remove_matches ^\s//
filter call_regexp_common C
filter remove_inline //.$
extension cs
3rd_gen_scale 1.36
end_of_line_continuation \\$
There currently isn't a way to do that. At best you could define a two
character word as a comment line, but not a blank line. If you have a version
of Perl installed on your machine you could do it in three steps:
using, for example,
perl -pi -e "s/^\s\w{2}\s$//" file(s)
Since step 2 modifies your original files you'll want to run that step on the
copy.