-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
build: search missing dependencies on lint-md #19249
build: search missing dependencies on lint-md #19249
Conversation
Makefile
Outdated
@@ -1072,6 +1089,11 @@ lint-md-build: tools/remark-cli/node_modules \ | |||
.PHONY: lint-md | |||
ifneq ("","$(wildcard tools/remark-cli/node_modules/)") | |||
|
|||
tools/find-missing-dependencies: \ | |||
tools/remark-preset-lint-node/package.json |
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.
Can you do the same for tools/remark-cli/package.json
? Thanks!
This will search if there are some dependencies that are missing. It will run with lint-md. It will check dependencies for remark-cli and remark-preset-lint-node
@nodejs/build |
This seems a bit complex, couldn't we just print a warning if the md linter fails that says that you might need to run (I haven't looked at this in great detail, so it's quite possible that wouldn't work, let me know if so!) |
@joyeecheung @Trott @gibfahn Any comments about this? Thanks!! |
I usually defer to others on Makefile stuff (which is why I pinged @nodejs/build). Two other people (besides @joyeecheung already pinged above) who have worked on Not sure what people will think of pulling If no one reviews this, I'll take a closer look and provide feedback or approve, but I think there are more qualified people than me to comment on Makefile changes. |
I don't think it's necessary to print every missing dependencies since the user is only going to run |
Do you mean in addition to this one?
|
@gibfahn Sorry the lateness,
If there is an error in the file |
ping @gibfahn |
Hello @estrada9166, IMHO as well, this a fairly complex solution. If I think about the problem space, a possible simpler solution would be to differentiate tool failure (such as a missing dep) from lint errors, and providing better feedback. If you manage to implement that, I would rather support that. Bottom line, when evaluating cost/benefit of the current solution, I'm don't feel it's worth the added complexity for fixing an edge case with a side tool 🤷♂️ |
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.
IMHO the current solution is too complex for the problem at hand
Okay, to check I'm understanding what you're saying, If one of the dependencies fails to install, (e.g. you do I also take your point that if we do what I suggested and always say "try running lint-md-clean && lint-md-build" then we'd be giving that suggestion even if there was a legitimate docs error. I understand that that's an issue, but I basically agree with @refack that this is a lot of complexity in a Makefile that is already very complex. |
In the discussion following #18981 (comment), decision was that making However, in the case we're talking about here, I don't think Makefiles have a concept of an optional dependency, but basically we could say that So maybe the answer would be to run |
Another option is to refactor out all of the doc linting (maybe even the doc building) into a seperate file. IMHO that would be a valuable contribution, but that might also be contentious, unless the UX will be kept simple as it is now. |
My biggest concern is the case that happened, and it is when a new
it will pass and it will throw the well-known error. |
I don't think that's true, the remark-lint package.json is checked into git, and @joyeecheung's PR means that if the package.json changes then |
What I'm saying is that |
Just to check if I understand, the suggestion is to call |
My suggestion (emphasis on the my, others may disagree) is that we do it if the |
The only thing with And running |
Okay, let me explain myself clearly, and you can tell me if it makes sense. My proposal is roughly: ifneq ("","$(wildcard tools/remark-cli/node_modules/)")
+ make lint-md-build # Probably won't look exactly like this
else
# Still skips as it does on master
endif There are two conditions:
If If
If |
I can make the change to run
|
This will likely be superseded by #20109 |
What's the current status on this one? |
I think this can be closed as the issues that it addresses have been closed and an alternate solution appears to have landed. Thanks for the pull request, @estrada9166, and if I'm wrong about this and this should remain open, leave a comment (or re-open it if GitHub presents a re-open button). |
This will search if there are some dependencies that are missing.
It will run with lint-md
Fixes: #18981
Fixes: #19189 (comment)
Fixes: #18978
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesMakeFile