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

UNC Paths Failing in New Version #276

Closed
jlukic opened this issue Apr 19, 2019 · 4 comments

Comments

2 participants
@jlukic
Copy link

commented Apr 19, 2019

Hey, thanks for the project. Really love your work.

Overview of problem

  • Files with UNC paths are now failing to lint. i.e. \\VM\example.js
  • Moving same file to non unc path C:\example.js works correctly
  • This is most likely a regression in a recent version of sublimelinter-eslint. I can confirm previous versions worked for these paths as I've used this setup for a few years.

How to reproduce

Setup:

  • SublimeText Windows
  • Network path (in my case Virtualbox Linux VM)

Repro Steps:

  • Open file from network path and attempt to lint
  • Notice it fails with error
  • Move same file to local path. Confirm file now lints.

Debug Output:

SublimeLinter: #97 linter.py:73       eslint output:
[{'errorCount': 1,
  'filePath': '\\\\VM\\the\path\tofile.js',
  'fixableErrorCount': 0,
  'fixableWarningCount': 0,
  'messages': [{'column': 7,
                'fatal': True,
                'line': 201,
                'message': 'Parsing error: Unexpected token newPosition',
                'ruleId': None,
                'severity': 2}],  'source': 'the source here',
  'warningCount': 0}]
SublimeLinter: #97 linter.py:1177     WARNING: eslint reported errors coming from '\\\\VM\\the\path\tofile.js'. However, reading that file raised:
  [Errno 2] No such file or directory: '\\\\VM\\the\path\tofile.js'.
@kaste

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

Hi @jlukic! Thanks for reporting. Have you mangled the output? I can see some oddities with UNC paths right now, but don't get your output.

  • Do you have set the working dir manually?
  • Can you use a local eslint, or do you use a global eslint executable?
  • Please, post the actual command SL tries here.
@jlukic

This comment has been minimized.

Copy link
Author

commented Apr 22, 2019

Ah yes, I removed the actual path and content of files for privacy, I'll go ahead and repost with a sample blank file.

SublimeLinter: #449 linter.py:1072    eslint: output:
  [{"filePath":"\\VM\\qualia\\services\\qualia\\app\\fake.js","messages":[{"ruleId":"no-extra-semi","severity":1,"message":"Unnecessary semicolon.","line":1,"column":1,"nodeType":"EmptyStatement","messageId":"unexpected","endLine":1,"endColumn":2,"fix":{"range":[0,1],"text":""}},{"ruleId":"eol-last","severity":1,"message":"Newline required at end of file but not found.","line":1,"column":2,"nodeType":"Program","messageId":"missing","fix":{"range":[1,1],"text":"\n"}}],"errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":2,"source":";"}]
SublimeLinter: #449 linter.py:73      eslint output:
[{'errorCount': 0,
  'filePath': '\\VM\\qualia\\services\\qualia\\app\\fake.js',
  'fixableErrorCount': 0,
  'fixableWarningCount': 2,
  'messages': [{'column': 1,
                'endColumn': 2,
                'endLine': 1,
                'fix': {'range': [0, 1], 'text': ''},
                'line': 1,
                'message': 'Unnecessary semicolon.',
                'messageId': 'unexpected',
                'nodeType': 'EmptyStatement',
                'ruleId': 'no-extra-semi',
                'severity': 1},
               {'column': 2,
                'fix': {'range': [1, 1], 'text': '\n'},
                'line': 1,
                'message': 'Newline required at end of file but not found.',
                'messageId': 'missing',
                'nodeType': 'Program',
                'ruleId': 'eol-last',
                'severity': 1}],
  'source': ';',
  'warningCount': 2}]
SublimeLinter: #449 linter.py:1177    WARNING: eslint reported errors coming from '\\VM\qualia\VM\qualia\services\qualia\app\fake.js'. However, reading that file raised:
  [Errno 2] No such file or directory: '\\\\VM\\qualia\\VM\\qualia\\services\\qualia\\app\\fake.js'.
SublimeLinter: #449 linter.py:1177    WARNING: eslint reported errors coming from '\\VM\qualia\VM\qualia\services\qualia\app\fake.js'. However, reading that file raised:
  [Errno 2] No such file or directory: '\\\\VM\\qualia\\VM\\qualia\\services\\qualia\\app\\fake.js'.
SublimeLinter: sublime_linter.py:507  Linting 'fake.js' took 0.96s

Now that i'm looking it does appear the path is getting tacked on twice on line 1177. Perhaps this is what's causing the issue.

You can see \\\\VM\\qualia\\VM\\qualia\\services\\qualia\\app\\ where the ESlint path is \\VM\\qualia\\services\\qualia\\app\\

@kaste

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2019

That's exactly what I'm seeing.

I have to make a PR against SublimeLinter core here because it is basically a bug in the Sublime API we have to workaround.

kaste added a commit to SublimeLinter/SublimeLinter that referenced this issue Apr 24, 2019

kaste added a commit to SublimeLinter/SublimeLinter that referenced this issue Apr 24, 2019

Fix Sublime's `expand_variables` for UNC paths
Fixes SublimeLinter/SublimeLinter-eslint#276

Explainer and origin: SublimeTextIssues/Core#1878

Sublime's `expand_variables` handles `\\` (two slashes) and reduces them to one.
We fix by adding more slashes before substituting.

@kaste kaste added the bug label Apr 25, 2019

@jlukic

This comment has been minimized.

Copy link
Author

commented May 13, 2019

Thanks @kaste for fixing this, appreciate your diligence fantastic work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.