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

Fix silent fail for UNC path files on Windows #3045

Open
plakhin opened this issue Nov 30, 2017 · 11 comments
Open

Fix silent fail for UNC path files on Windows #3045

plakhin opened this issue Nov 30, 2017 · 11 comments
Labels
status: needs investigation triage needs further investigation type: bug a problem with a feature or rule

Comments

@plakhin
Copy link

plakhin commented Nov 30, 2017

Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?

stylelint doesn't work with network file paths e.g. stylelint \\192.168.0.1\httpdocs\public\css\,
local file paths e.g. stylelint c:\httpdocs\public\css\ work fine.

What CSS is needed to reproduce this issue?

any

What stylelint configuration is needed to reproduce this issue?

{
  "extends": "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\stylelint-config-recommended"
}

Which version of stylelint are you using?

8.3.1

How are you running stylelint: CLI, PostCSS plugin, Node API?

CLI with stylelint \\192.168.0.1\httpdocs\public\css\

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

No

What did you expect to happen?

The same as with local file.

What actually happened (e.g. what warnings or errors you are getting)?

No errors or warnings, no output at all, the same as if I run
stylelint c:\httpdocs\public\css\nonexistent.css

@hudochenkov
Copy link
Member

Thanks for the report and for using the template.

We'll not add this feature as downloading files over a network is out of scope for linting software.

@plakhin
Copy link
Author

plakhin commented Dec 5, 2017

@hudochenkov Thanks for response, but seems like there is some misunderstanding.
I'm using Sublime Text and VS Code for working with files on a network share (I guess I'm not the only one who works with files over usual network) and tools like eslint or phpcs works fine, but stylelint doesn't. Moreover, it doesn't produce any error, only exits silently so it wasn't easy to find whats going on.
So I don't understand what do you mean by "...downloading files over a network is out of scope for linting software." This issue is only about supporting UNC Paths.

@hudochenkov
Copy link
Member

What you initially described is running stylelint from CLI and passing path for remote files to it. In order to do this stylelint would be needed to downloading a file over a network to be able to lint. stylelint doesn't do this. I bet eslint doesn't support this either.

Why remote file isn't linted in an editor via editor plugin is a different story. There might be a problem with a way how editor plugin run linter and pass a code and options to it. Try to ask in your editor plugin repository.

@plakhin
Copy link
Author

plakhin commented Dec 5, 2017

I bet eslint doesn't support this either.

It does. Just check. Eslint CLI supports UNC Paths. Working with network shares in MS Windows using UNC Paths should be 'transparent', so files don't need to be downloaded first.

Why remote file isn't linted in an editor via editor plugin is a different story. There might be a problem with a way how editor plugin run linter and pass a code and options to it. Try to ask in your editor plugin repository.

I'm using SublimeLinter-contrib-stylelint. I guess it just executes stylelint and passes file path as an argument.

@hudochenkov
Copy link
Member

I'll reopen this issue, maybe other maintainers have thoughts about this.

I can't test anything on Windows. Can't help more for now.

@hudochenkov hudochenkov reopened this Dec 5, 2017
@hudochenkov hudochenkov added the status: needs investigation triage needs further investigation label Dec 5, 2017
@jeddy3
Copy link
Member

jeddy3 commented Dec 7, 2017

Working with network shares in MS Windows using UNC Paths should be 'transparent', so files don't need to be downloaded first.

It does sound like there's a bug. @plakhin Are you familiar with UNC paths and network shares? Would you be able to investigate further into the code base as I believe most of the stylelint contributors have limited access to the windows machines?

@jeddy3 jeddy3 changed the title lint files over network Fix silent fail for UNC path files on Windows Dec 7, 2017
@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule and removed status: needs investigation triage needs further investigation labels Dec 7, 2017
@plakhin
Copy link
Author

plakhin commented Dec 7, 2017

@jeddy3 I'll try to help, of course, but I'm not very good with node.js.
And as I think, at first, stylelint should return an error instead of die silently if path/file was not found. This is true for local files also.

@jeddy3
Copy link
Member

jeddy3 commented Dec 7, 2017

And as I think, at first, stylelint should return an error instead of die silently if file/path was not found. This is true for local files also.

Yikes. That's very much a bug and not the intended behaviour. We even have a --allow-empty-input flag to reverse the intended default behaviour of throwing an error in the glob input doesn't match any files. I'll create a separate issue for this as it's not specifically related to UNC paths.

@plakhin
Copy link
Author

plakhin commented Dec 7, 2017

I'll create a separate issue for this as it's not specifically related to UNC paths.

And as soon as it will be resolved the bug with UNC Paths will become more understandable.

Copy link
Contributor

This issue is older than one month. Please ask before opening a pull request, as it may no longer be relevant.

@github-actions github-actions bot added status: ask to implement ask before implementing as may no longer be relevant and removed status: ready to implement is ready to be worked on by someone labels Jan 22, 2024
@Mouvedia
Copy link
Contributor

Mouvedia commented May 9, 2024

I cannot reproduce either but fast-glob has updated glob version to 10—from ^7.1.4—in version 3.3.0 which we bumped to in version 15.10.0.
Version 9 of glob elevated UNC paths citizenship to "first class".
i.e. it might have been fixed last year

@Mouvedia Mouvedia added status: needs investigation triage needs further investigation and removed status: ask to implement ask before implementing as may no longer be relevant labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs investigation triage needs further investigation type: bug a problem with a feature or rule
Development

No branches or pull requests

4 participants