-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
ignore
dependency upgrade should be reverted
#41
Comments
Thanks for the detailed report, do you really think we should revert, or can we fix this? |
Not clear to me how it would be fixed. Maybe you have an idea? |
According to the issue thread, resolving the correct ignore path should be done in userland, but not clear to me what your intent is in the relevant |
I recommended reverting as the bug seems directly related to the change in |
I’d rather include a fix, because that way we can keep up with the latest What I’m wondering is whether we could pass an absolute path in instead, as a fix? |
No. Already tried that. Does not work. |
Not clear to me that you need to keep up with the latest |
Here is the error I got when I changed the relevant line to use an absolute path: callback(null, normal ? ignore.ignores(resolve(self.cwd, filePath)) : false)
|
Keeping up to date is not necessarily a good effort in and off itself, but from what I know, Node/npm projects typically only have one release line, therefore using the latest semver It’s a bit late here so I’d rather work on this tomorrow, but if you have time to work on this, I’d appreciate a PR with a failing test and I can work on a fix tomorrow! |
Re: release lines. Understood and recognized. Not clear to me how you'll want to address this atm. |
Not sure either, yet 🤷♂️ |
Say I place your ignore file in $ pwd
/Users/tilde/oss/unified-engine
$ ./node_modules/.bin/remark --ignore-path=./path/to/.ignore ./path/to/file.md
asdasdasd
path/to/file.md: no issues found ...yields no problems. I need more information about what you are actually doing to debug this. |
I just ran the following command and encountered the following results:
If I run the command without specifying the |
This looks pretty similar to my case above, but for me it works, so I need more information to reproduce your issue: can I get the code project? What versions of node / deps? Etc |
Maybe the issue is that the ignore file is not in the current working directory, but a child directory of a sibling folder. The relative path walking in the error message matches |
See the node version and deps version in the OP. The project is stdlib. Here is the full command I run locally which generates the error:
from the top-level project directory. |
I can confirm that, if I place the |
Ah that'll help, thanks! |
However, the error still remains that ignore files which do not reside along the file path result in runtime errors. |
Right, we can work on that now we know the issue! |
@wooorm I am working on a PR to fix this issue, but wanna clarify some concepts. say we have this folder structure:
in the same scenario, if specified so if we wanna ignore all txt files in
My point is
agree? |
Hey @foray1010, thanks for working on this!
|
Do you mean the patterns in given ignore files should be relative to the location of themselves? I would like to create a npm package that provide ignore files so that I don't have to sync them on all my repos |
Hmm, I see a couple different use cases for custom ignore path: ./cli.js --ignore-path=.gitignore # To use the patterns in a file with a different name # A
./cli.js --ignore-path=config/.remarkignore # So all config is in a different place # B
./cli.js --ignore-path=node_modules/my-config/.remarkignore # C
Are you sure ESLint ignores relative to the CWD in case of custom ignore paths? I didn’t find that in the docs. |
Oh and could you expand on what you want to put in your ignore? |
here is an example of
|
@wooorm I created a demo repo to show how eslint, prettier and stylelint work: https://github.com/foray1010/test-ignore-files you can try by # patterns are relative to cwd, it successfully ignored demo.js & demo.css
yarn cwd:eslint
yarn cwd:prettier
yarn cwd:stylelint
# patterns are relative to the ignore files, it failed to ignore demo.js & demo.css
yarn relative_patterns:eslint
yarn relative_patterns:prettier
yarn relative_patterns:stylelint |
🤔 |
Also: the big caveat here is that |
Prettier
Note that |
Circling back...was this issue resolved or should we plan on downgrading to a previous version? |
Hey sorry about that! It’s been a while since I looked at it and I’m unclear how to proceed. |
I pushed a PR that should solve reusable configuration, such as in @kgryte’s |
@wooorm Wow! Thanks!!! That is awesome! |
Related to unifiedjs/unified-engine#41. Related to unifiedjs/unified-engine#43.
Subject of the issue
In the
7.0.0
release, theignore
dependency was upgraded to version5
, a semver major upgrade, which changed how relative paths are ignored (see kaelzhang/node-ignore#20).At L38 of the
ignore.js
file, you resolve a file path to a relative path. This causesignore
to throw an error becauseignore
does not accept relative paths.For example, when running
remark
on a Markdown file, I encounter the following error:Your environment
Steps to reproduce
Tell us how to reproduce this issue. Please provide a working and simplified example.
Run a command similar to the following (using
remark
and notunified-engine
directly):For the used
.remarkignore
file, see here.Expected behaviour
No error should occur.
Actual behaviour
The following error is encountered:
The text was updated successfully, but these errors were encountered: