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
standard v14 not working with files in a different directory #1384
Comments
I have the same error with standard@13 but not with standard@12 |
I am seeing this error as well on macos with node@10 via homebrew:
It's causing problems when standard is used with ALE because ALEFix calls standard via a temp file. |
Can you run |
|
I'm on holidays until September 23rd. I'll get back to this as soon as I'm
back
El mié., 11 sept. 2019 16:55, theimpostor <notifications@github.com>
escribió:
… ~ npm ls -g ignore
/usr/local/lib
└─┬ ***@***.***
├─┬ ***@***.***
│ └── ***@***.***
├─┬ ***@***.***
│ └── ***@***.***
└─┬ ***@***.***
└─┬ ***@***.***
└── ***@***.***
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1384?email_source=notifications&email_token=AAAWOWYXSUIGPINZLK22MKDQJEBGVA5CNFSM4IOMEJBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OYYYI#issuecomment-530418785>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAWOW7W2QIDQYWOCDIGELDQJEBGVANCNFSM4IOMEJBA>
.
|
AFAIK this problem is related to dep. Ignore
El mié., 11 sept. 2019 20:51, Pedro Narciso García Revington <
p.revington@gmail.com> escribió:
… I'm on holidays until September 23rd. I'll get back to this as soon as I'm
back
El mié., 11 sept. 2019 16:55, theimpostor ***@***.***>
escribió:
> ~ npm ls -g ignore
>
> /usr/local/lib
>
> └─┬ ***@***.***
>
> ├─┬ ***@***.***
>
> │ └── ***@***.***
>
> ├─┬ ***@***.***
>
> │ └── ***@***.***
>
> └─┬ ***@***.***
>
> └─┬ ***@***.***
>
> └── ***@***.***
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#1384?email_source=notifications&email_token=AAAWOWYXSUIGPINZLK22MKDQJEBGVA5CNFSM4IOMEJBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OYYYI#issuecomment-530418785>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAAWOW7W2QIDQYWOCDIGELDQJEBGVANCNFSM4IOMEJBA>
> .
>
|
I think I figured out the issue. In @theimpostor @revington Do you mind sharing if you're passing an |
In my case I am using standard installed via 'npm install -g standard'.
Here is the command ALE is running and getting an error back:
(finished - exit code 1) ['/usr/local/bin/bash', '-c', '''standard'' --fix
''/var/folders/mk/_gnvhfnn339_pqkx_7m8m5200000gp/T/nvimfeWbPA/6/index.js''']
…On Wed, Sep 11, 2019 at 2:27 PM Feross Aboukhadijeh < ***@***.***> wrote:
I think I figured out the issue. In ***@***.*** there was a breaking
change which we didn't handle correctly:
https://github.com/kaelzhang/node-ignore#upgrade-4x---5x
@theimpostor <https://github.com/theimpostor> @revington
<https://github.com/revington> Do you mind sharing if you're passing an
--ignore flag to standard, or if you specified any config options in the
"standard" field in package.json. I assume that you must have done so.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1384?email_source=notifications&email_token=AAKAALWRSS5GXGZY2CYE2S3QJFBBNA5CNFSM4IOMEJBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6PTWRA#issuecomment-530529092>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAALXG6D62DSY3R7OO4VLQJFBBNANCNFSM4IOMEJBA>
.
|
Thanks. Just a few more questions:
|
No "standard" option in package.json.
You can see my project itself if it helps - no real references to 'standard' (I am using it via npm global install). |
This is still broken. |
@feross were you able to reproduce, please? |
@feross - I came across this running For context, I have a complex build & test environment. I've abstracted the build/test aspects into their own local modules. My project structure looks like this:
I'm running standard as part of an npm script within the If Standard isn't supposed to support this, no worries (consider this a feature request). If it is supposed to support this, the issue stems from ignore/index.js#354, where the regex is marking these relative paths as invalid. For what it's worth, I changed that line to the following (reverse the checkPath): Doing that, all worked as expected, despite the quick hack and zero impact testing. Standard still respected my rather large list of ignore patterns. |
I'm seeing this as well using |
A debugging clue... I worked around this by manually editing
To be clear, this change worked for both:
Not sure what's leading up to this call to filter, but it seems broken. 🤷♂ |
The standard linter --fix fails if the file being input is not relative to the project root (standard/standard#1384). This MR attempts to fix this by changing the command so the input file is relative to the project root and the output is to a temporary file. Preliminary tests with toy javascript projects seem to indicate this works fine.
I can no longer reproduce this issue, so perhaps it was fixed upstream in So, this issue should be fixed! |
This will be fixed in |
What version of this package are you using?
14.0.0
What operating system, Node.js, and npm version?
Void Linux, node 10.16.3, npm 6.9.0
What happened?
$ standard --fix $file-not-same-directory
fails withbut
$ standard --fix file.js
works as expectedThe text was updated successfully, but these errors were encountered: