Repository navigation
Conversation
|
I'm not sure why is prettier failing in Windows 🤔 |
| .split("\n") | ||
| .map(s => s.trim()) | ||
| .filter(x => x !== ""); | ||
| .map(s => s.replace(/^\!\s+/, '!').trim()) |
There was a problem hiding this comment.
Can you explain what does this line do and why is this required?
There was a problem hiding this comment.
All white spaces after an exclamation sign in lines starting with exclamation sign are removed. Is required for normalization of excluded paths.
There was a problem hiding this comment.
@mondeja Is this normalization really required? In most cases, I've seen people never use spaces after ! . A simple trim() should be good enough. @bishal-pdMSFT thoughts?
There was a problem hiding this comment.
Also, can you push a commit to rerun the workflows, I'm unable to see the old logs to check by windows build is failing.
There was a problem hiding this comment.
I'm not sure if it is really "required". It seems that can be declared with space but the hash will not be the same.
A simple trim() should be good enough.
I don't follow you. This implementation is not trimming, ! foo should be converted to !foo but .trim() does not modificates it ('! foo'.trim() === '! foo' is true).
There was a problem hiding this comment.
I understand but what I'm saying is that people don't normally use ! foo, they'll just use !foo directly, as mentioned in our docs.
There was a problem hiding this comment.
Seems to be some prettier issue for windows. Can you run npm run format once to see if it produces any changes?
There was a problem hiding this comment.
npm run format does not produce changes in my Ubuntu, seems only failing in Windows.
I understand but what I'm saying is that people don't normally use ! foo, they'll just use !foo directly, as mentioned in our docs.
I haven't used the space in the past and don't have any preference about it. Just implemented here because it is possble to include the space after the exclamation sign using @actions/glob API directly:
> const glob = require('@actions/glob');
> const globber = await glob.create(['node_modules/.bin/*', '! node_modules/.bin/mkdirp'].join('\n'))
> await globber.glob()But is up to you to include this change or not, keeping in mind that although is possible and works the hash will not match if in one run the space exists and in other not.
|
@mondeja Unless the windows-latest test is fixed, I won't be able to merge this. Please see if you can fix it. |
OK, but I need approval for workflow runs because I'm not able to reproduce the error locally. |
|
Not totally sure if it is passing now, but I've tried to rebuild and raises conflicts, that's why I've force pushed. IHMO, the |
|
@mondeja Yes, please regenerate dist/ as that will be required for merging. When we create a new release, users using actions/cache@v3 will be pointed to the new release with this code. |
|
Regenerated, see the conflicts |
|
Hmm for dist/ files there shouldn't be conflicts. I'll take a look. |
|
@mondeja What version of npm are you using ? |
|
Node v16 and NPM v8, what version should I use? |
|
Hi @mondeja dist/ files should not be generated, I just tried on main with your changes. Can you try to update your main from actions/cache and then rebase this branch from that main. |
|
Done. I've reverted to the change previous regeneration, merged Trying to regenerate with Errors |
|
Apologies for the delay, I'll try to take a look this week and see if I can cherry pick and commit this change without the check dist/ check failing. |
|
Cherry-picked this commit and working on it in #903. So, closing this for now. Thank you the contribution. Will get merged soon. 🙌 |
Fixes #345