Skip to content

Commit

Permalink
Merge pull request #100 from zwrawr/consistency-check
Browse files Browse the repository at this point in the history
"Fix" for Consistency check #90
  • Loading branch information
flosse authored Mar 7, 2018
2 parents 7603cc6 + 8aa629c commit f7d8aa2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 25 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 10 additions & 8 deletions spec/sloc.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -69,6 +70,7 @@ describe "The sloc module", ->
'single'
'block'
'mixed'
'blockEmpty'
'empty'
'todo']
sloc.keys.should.be.an 'array'
Expand Down
2 changes: 1 addition & 1 deletion src/formatters/simple.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ module.exports = (data, options={}, fmtOpts) ->

result += d.join ''

result += "\n\n------------------------------\n"
result += "\n\n----------------------------\n"
17 changes: 9 additions & 8 deletions src/i18n.coffee
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
17 changes: 9 additions & 8 deletions src/sloc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ Copyright 2012 - 2017 (c) Markus Kohlhase <[email protected]>
###

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'
]

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit f7d8aa2

Please sign in to comment.