diff --git a/README.md b/README.md index dbb23ef..fb4ad60 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Create stats of your source code: - lines with single-line comments - lines with block comments - lines mixed up with source and comments +- empty lines within block comments - empty lines - lines with TODO's diff --git a/spec/sloc.spec.coffee b/spec/sloc.spec.coffee index e3d64ae..b5b33f4 100644 --- a/spec/sloc.spec.coffee +++ b/spec/sloc.spec.coffee @@ -16,14 +16,15 @@ describe "The sloc module", -> it "should handle CRLF line endings", -> sloc("a\r\nb\r\nc", "js").should.eql - block: 0 - comment: 0 - empty: 0 - mixed: 0 - single: 0 - source: 3 - todo: 0 - total: 3 + block: 0 + blockEmpty: 0 + comment: 0 + empty: 0 + mixed: 0 + single: 0 + source: 3 + todo: 0 + total: 3 it "should handle CR line endings", -> sloc("a\rb\rc", "js").total.should.equal 3 @@ -69,6 +70,7 @@ describe "The sloc module", -> 'single' 'block' 'mixed' + 'blockEmpty' 'empty' 'todo'] sloc.keys.should.be.an 'array' diff --git a/src/formatters/simple.coffee b/src/formatters/simple.coffee index f0db4e9..c042ccc 100644 --- a/src/formatters/simple.coffee +++ b/src/formatters/simple.coffee @@ -44,4 +44,4 @@ module.exports = (data, options={}, fmtOpts) -> result += d.join '' - result += "\n\n------------------------------\n" + result += "\n\n----------------------------\n" diff --git a/src/i18n.coffee b/src/i18n.coffee index d869d74..4c1a556 100644 --- a/src/i18n.coffee +++ b/src/i18n.coffee @@ -1,13 +1,14 @@ module.exports = en: - total : "Physical" - source : "Source" - comment : "Comment" - single : "Single-line comment" - block : "Block comment" - mixed : "Mixed" - empty : "Empty" - todo : "To Do" + total : "Physical" + source : "Source" + comment : "Comment" + single : "Single-line comment" + block : "Block comment" + blockEmpty : "Empty block comment" + mixed : "Mixed" + empty : "Empty" + todo : "To Do" Result : "Result" Path : "Path" diff --git a/src/sloc.coffee b/src/sloc.coffee index 2916a87..536c2be 100644 --- a/src/sloc.coffee +++ b/src/sloc.coffee @@ -4,13 +4,14 @@ Copyright 2012 - 2017 (c) Markus Kohlhase ### keys = [ - 'total' # physical lines of code - 'source' # lines of source - 'comment' # lines with comments - 'single' # lines with single-line comments - 'block' # lines with block comments - 'mixed' # lines mixed up with source and comments - 'empty' # empty lines + 'total' # physical lines of code + 'source' # lines of source + 'comment' # lines with comments + 'single' # lines with single-line comments + 'block' # lines with block comments + 'mixed' # lines mixed up with source and comments + 'blockEmpty' # empty lines with a block comment + 'empty' # empty lines 'todo' ] @@ -246,7 +247,7 @@ slocModule = (code, lang, opt={}) -> console.log res if opt.debug # result - { total, source, comment, single, block, mixed, empty, todo } + { total, source, comment, single, block, mixed, empty, todo, blockEmpty } extensions = [ "asm"