Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

space-validator and tab-validator reports error at valid empty indented line #33

Merged
merged 2 commits into from
Jun 11, 2018

Conversation

ndxbn
Copy link
Contributor

@ndxbn ndxbn commented Jun 7, 2018

% ls -al
total 8
drwxrwxr-x. 2 vagrant vagrant  80 Jun  7 10:29 .
drwxrwxrwt. 4 root    root     80 Jun  7 10:28 ..
-rw-rw-r--. 1 vagrant vagrant  55 Jun  7 10:29 .editorconfig
-rw-rw-r--. 1 vagrant vagrant 115 Jun  7 10:29 example.yml

.editorconfig is

root = true

[*]
indent_style = space
charset = utf-8

example.yml is

- name: e.g.
  example: |
    next line is empty, but kept indent
    
    this is third line in "example"'s value

expect

sucessfully checked 2 files :)

Actual

1) ./example.yml
        4: Mixed indentation (only spaces expected)

1 errors occured! See log above and fix errors

@@ -9,7 +9,7 @@ const validate = (line, lineNumber, editorconfig) => {
}
}

if (!line.match(/^ *[^\s]+/)) {
if (!line.match(/^ *[\S\r\n]+/)) {
Copy link
Contributor Author

@ndxbn ndxbn Jun 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\S is same ^\s , but [[^\s]\r\n] won't work in JavaScript.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.235% when pulling 38bd79c on ndxbn:develop into 3824852 on editorconfig-checker:master.

@mstruebing
Copy link
Member

Hey thanks for your PR and especially that you've added test-cases for it. :)
I will try it out later but it seems good at the first glance

@mstruebing mstruebing merged commit ee73069 into editorconfig-checker:master Jun 11, 2018
@ndxbn
Copy link
Contributor Author

ndxbn commented Jun 11, 2018

I'm sorry to mistake that this pull request patch is NOT enough 🙇. Because the {space, tab}-validator's line argument has NOT EOL. validation-processor passes line without EOL, because fileContentArray makes by split(getEndOfLineChar(editorconfig.end_of_line));.

I think validation-processor should pass line with EOL, because some text file can contain CR and/or LF not for line break.

e.g. in CSV data:

name,message
"Mike","Hi! I'm Mike!![CR][LF]I'm a teacher!!"[CR][LF]
"Tony","My name is Tony.[LF]I can speac English a little."[CR][LF]
"Mary","I am Mary,I am Japanege!![CR]I like sushi so much."[CR][LF]

This CSV file may be valid for RFC4180.

I work to resolve this issue until next Sunday.
If I should make GitHub Issue on first, I'll do it. 😎

@mstruebing
Copy link
Member

Thanks for taking care! I have not much time at the moment to work on my projects so your help is very appreciated ! 👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants