Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

Add support for non doc block comment #87

Merged
merged 8 commits into from
Aug 2, 2017
Merged

Conversation

gucong3000
Copy link
Collaborator

@gucong3000 gucong3000 commented Jul 31, 2017

Fixes: #85

eclint.fix:

input:

/* block
comment */
/*  block
comment */
/*
block
comment
*/
/*
* document
* comment
*/

output:

/* block
   comment */
/*  block
    comment */
/*
   block
   comment
 */
/*
 * document
 * comment
 */

Repository owner deleted a comment from codecov bot Jul 31, 2017
Repository owner deleted a comment from codecov bot Jul 31, 2017
@codecov
Copy link

codecov bot commented Jul 31, 2017

Codecov Report

Merging #87 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   96.64%   96.72%   +0.08%     
==========================================
  Files          13       13              
  Lines         566      581      +15     
  Branches      111      115       +4     
==========================================
+ Hits          547      562      +15     
  Misses         11       11              
  Partials        8        8
Impacted Files Coverage Δ
lib/doc.ts 100% <100%> (ø) ⬆️
lib/rules/indent_size.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d01815...c8f5a6e. Read the comment docs.

@silverwind
Copy link
Contributor

silverwind commented Jul 31, 2017

I've been testing this, but I can't see a difference.

.editorconfig

root = true

[*]
indent_style = space
indent_size = 2

[*.js]
block_comment_start = /*
block_comment_end = */

test.js

function() {
  /* block
     comment */
  function() {
    /* block
       comment */
    function() {
      /* block
         comment */
    }
  }
}

Running node_modules/eclint/bin/eclint.js check test.js shows three errors:

test.js
    [03:01] ❌️ invalid indent size: 5, expected: 9 (EditorConfig indent_size https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size)
        03|     comment */
    [06:01] ❌️ invalid indent size: 7, expected: 11 (EditorConfig indent_size https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size)
        06|       comment */
    [09:01] ❌️ invalid indent size: 9, expected: 13 (EditorConfig indent_size https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size)
        09|         comment */

@gucong3000
Copy link
Collaborator Author

@silverwind fixed for your testcase.

@silverwind
Copy link
Contributor

silverwind commented Aug 1, 2017

Hmm, still won't work for me:

$ node_modules/eclint/bin/eclint.js check test.js
ectest.js
    [03:01] ❌️ invalid indent size: 5, expected: 6 (EditorConfig indent_size https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size)
        03|     comment */
    [06:01] ❌️ invalid indent size: 7, expected: 8 (EditorConfig indent_size https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size)
        06|       comment */
    [09:01] ❌️ invalid indent size: 9, expected: 10 (EditorConfig indent_size https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size)
        09|         comment */
$ npm ls eclint
/Users/silverwind/git/test
└── [email protected]  (github:jedmao/eclint#ace333f059906f008ae0dfcafc45da51f4253a45)

@gucong3000 gucong3000 merged commit 1823885 into master Aug 2, 2017
@gucong3000 gucong3000 deleted the non_doc_block_comments branch August 2, 2017 09:16
@gucong3000
Copy link
Collaborator Author

gucong3000 commented Aug 2, 2017

Hmm, still won't work for me

This reason of error should be have not build.

@silverwind
Copy link
Contributor

Appears so. I just tested against master and it now works, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support block comments defined only via start and end
2 participants