-
Notifications
You must be signed in to change notification settings - Fork 16
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
Filter dependencies by file #536
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea to enable restricting to a set of files! But specifying the files as an option is not as flexible as providing them as command arguments, letting the shell expand wildcards and all. For instance:
npm run check-dependencies -- --filesToCheck="docs/developing/octez-client/*.md"
complains about a non-existent file, while it should find several ones (also tried without the quotes)- instead,
npm run check-dependencies -- --filesToCheck=docs/developing/octez-client/*.md
could check all the matching files
(My remarks are just comments, I'm not against keeping the UI as it is, if you prefer it; I just wanted to see if a review requesting changes creates a thread or no -- but visibly not!) |
We could adapt to accept wildcards, but this script is mainly for the CI, and a github action will list all changed files in a PR without wildcards. |
Well, I imagine that the github action will not use the |
We can feed the list of files from the github action to any place in the command, as in this example: I don't have a strong opinion about this; if we think people are going to test files manually on the CLI I can make this an anonymous CLI option |
Being able to run this checks manually in a flexible way will definitely be useful for us, maintainers, for planning the work at different levels of priorities. Say we don't have time to retest all the tutorials reported by the github actions, but we want to retest just those:
As we cannot anticipate all the possible scenarios, being able to execute different queries will allow us to adjust the changes to the resources we have. So yes, for this reason, it would be nice to accept shell-expanded arguments as lists, passed as an anonymous option. |
Having a named parameter doesn't prevent any of this, but if you prefer it that way, fine, I made the file names an anonymous parameter, as in this example:
|
Thanks, I think it's much more flexible now, that I can do a command like this:
So the UI is perfect now! |
As a minor issue, I experienced a failure when omitting the
|
The |
Fine then, LGTM. |
Eventually we'll want to filter the dependency check by file, so this PR reworks the script into accepting three params:
npm run check-dependencies -- --dependencies=smartpy,taquito
.--major
or--minor
to check for differences at those levels.npm run check-dependencies -- --filesToCheck=docs/developing/octez-client/accounts.md,docs/tutorials/build-your-first-app.md
.The script has error-checking to catch unknown parameters and dependencies. If you pass an incorrect file path, you'll get the usual Node ENOENT error for the missing file.