Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

jscs . hangs when running on Node 0.11 in Windows #703

Closed
UltCombo opened this issue Oct 21, 2014 · 12 comments
Closed

jscs . hangs when running on Node 0.11 in Windows #703

UltCombo opened this issue Oct 21, 2014 · 12 comments
Labels

Comments

@UltCombo
Copy link

Looks like a really localized issue. Basically, the command:

jscs .

Hangs and never finishes. Note that it is only reproducible with Node 0.11.x on Windows. It works fine with Node 0.11 on Unix-based systems, and it also works fine with Node 0.10 on Windows.

@UltCombo
Copy link
Author

Test case:

Tested on Windows 7 x64 Ultimate, Node 0.11.14, jscs 1.7.3

@markelog
Copy link
Member

Well, we do not support node 0.11 no one does i suppose.

@gustavohenke
Copy link
Member

@markelog I have seen some packages that do test against Node 0.11.
Anyway, I think that it should be somehow supported now that ES6 support finally landed - Node 0.10 doesn't have a strong support for ES6, but 0.11 does.

@UltCombo
Copy link
Author

@markelog seeing as Node 0.11 will be the base for 0.12, I believe it makes sense to test against it. Most packages I use work just fine on Node 0.11.

Most of the time, it only takes very small changes in order to be compatible with 0.11. I can try to triage this issue when I have a bit more of free time.

@mikesherov
Copy link
Contributor

@UltCombo, thanks for contributing. If you could look into this issue, it would be very helpful. I don't have a windows box to test on :-\

@UltCombo
Copy link
Author

It works fine when I add a -c .jscsrc parameter. Looks like the issue is with the implicit loading of the config file, it is not finding the .jscsrc file even though it is in the current working directory.

@UltCombo
Copy link
Author

Weirdly enough, the .jscsrc is actually loaded correctly at this point in both paths (with and without the -c option), however, the checker._isExcluded logic is failing when the -c option is not provided.

@UltCombo
Copy link
Author

Found the issue here.

path.dirname() returns an uppercase drive letter while process.cwd() returns a lowercase drive letter. Then the path.resolve here keeps the original casing and minimatch does not play well with lowercase drive letters apparently.

This is probably a Node issue though, I recall seeing some discussion about drive letter casing, I'll have to check on their repository to see if there has been a consensus.

@mrjoelkemp
Copy link
Member

Great job! Sounds like a doozy
On Oct 21, 2014 8:15 PM, "Fabrício Matté" notifications@github.com wrote:

Found the issue:
https://github.com/jscs-dev/node-jscs/blob/master/lib/checker.js#L29

path.dirname() returns a capitalized drive letter while process.cwd()
returns a lower-case drive letter. Then the path.resolve here
https://github.com/jscs-dev/node-jscs/blob/master/lib/options/exclude-files.js#L6
keeps the original casing and minimatch does not play well with lowercase
drive letters apparently.

This is probably a Node issue, I recall seeing some discussion about drive
letter casing, I'll have to check on their repository to see if there has
been a consensus.


Reply to this email directly or view it on GitHub
#703 (comment).

@UltCombo
Copy link
Author

The issue could be worked around here by using Minimatch's nocase option on Windows platforms (as Windows paths are case-insensitive anyway).

However, it looks like path.resolve() will be changed to always return lowercase drive letters (nodejs/node-v0.x-archive#8385), so I guess this issue should fix itself when Node 0.12 is released.

@markelog
Copy link
Member

@UltCombo riiight, that is why it's not pragmatic to test your stuff on unstable platform, since most of those inconsistencies will disappear in stable release.

If you want to run your code on .11 that is one thing (if your thing is doubling your work efforts) but you don't have to use jscs with .11 just use it with .10 for code your written for .11.

@UltCombo
Copy link
Author

@markelog

If you want to run your code on .11 that is one thing (if your thing is doubling your work efforts)

Not when you don't have a choice. There are quite a handful of projects which are only compatible with >= 0.11.

but you don't have to use jscs with .11 just use it with .10 for code your written for .11.

Sure thing, however, I believe it is rather cumbersome to setup tests to have jscs run on .10 and unit tests on .11, in both local development and Travis.

Anyway, this issue is workable around on my end so no worries. I'll bring this topic to the Node repository which should be the proper place for this issue, and perhaps suggest an workaround on Minimatch.

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

No branches or pull requests

5 participants