-
Notifications
You must be signed in to change notification settings - Fork 897
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
[linters] Install tools based on versions in package.json #2323
[linters] Install tools based on versions in package.json #2323
Conversation
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.
❤️
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.
This is great! I just left a few small things.
030c93d
to
33be543
Compare
33be543
to
5ca87aa
Compare
Rebased and conflicts resolved. Ready for a final review. |
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.
Looks good to me! I only have one concern about pinning package versions to avoid surprises (as we had a few days ago). But I'll leave that to others to consider as well.
@joaopgrassi - thanks for the feedback! I've made the changes that you suggested. PTAL |
I believe that the last issue has been addressed. PTAL |
0fa49c7
to
c354ac7
Compare
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.
LGTM and thanks for working on this!
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
c354ac7
to
0e63459
Compare
21d4389
to
7843f42
Compare
Hi all: I've restored the old target behavior by using install-checks. I see this as win-win, WDYT @Oberon00, @joaopgrassi, @yurishkuro @carlosalberto and others? While conceptually less clean, this addresses the concerns that @Oberon00 raised. My hope is that we can now have enough of a consensus to get this PR merged. |
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.
Both approaches are fine to me. I'm no expert in Make, but the build passes and I don't see anything clearly wrong. 👍
Thanks for the feedback @joaopgrassi. |
I am resolving discussions and merging. Feel free to open new tickets if changes are needed, but in the current state the PR is an overall improvement. |
npx
to run npm cmds, not hardcoded paths
@chalin After this change I can no longer do
Any advice on what I need to do to make this work locally? |
Indeed - why did CI pass then? It works for me after this patch: diff --git a/Makefile b/Makefile
index e0d64e4..755e8e6 100644
--- a/Makefile
+++ b/Makefile
@@ -58,7 +58,7 @@ markdownlint:
@if ! npm ls markdownlint; then npm install; fi
@for f in $(ALL_DOCS); do \
echo $$f; \
- npx --no -p markdownlint-cli markdownlint -c .markdownlint.yaml $$f \
+ npx --no -p markdownlint markdownlint -c .markdownlint.yaml $$f \
|| exit 1; \
done however it seems to be re-doing npm install for each file:
|
I suggest we revert this PR until it can be properly fixed |
also, we need to add |
Checking. Yes, adding an |
Indeed, possibly a Node version issue.
It works fine for me locally under macOS 11.6.4. I'm using the latest LTS version of Node: $ nvm current
v16.13.0 You? |
Done, see #2401. |
Confirmed, works w/ v16, but not with v14. |
v16 works for me too. |
…etry#2323) * [editorial] Use `npx` to run npm cmds, not hardcoded paths * Update Makefile based on feedback * Use --no-install option for npx * Add `npm install` to markdown-check workflows * Pin markdownlint-cli at 0.31.0 * Run `npm install` as a separate workflow step * Use name 'install dependencies' for npm install cmd * CONTRIBUTING: clarify that you install the tools once * make: add `install-tools` as dependency to `all` * Add install check line to `mardown*` targets Co-authored-by: Yuri Shkuro <[email protected]>
I'm having issues running certain spec checks from the website because it's working from a spec submodule. This PR:
npx
to run npm commands rather than hardcoded pathsnpm install
to install all necessary NPM-based toolspackage.json
file for this purpose -- withmarkdownlint-cli
pinned tov0.31.0
as was done in Pin markdownlint-cli version and apply fixes #2320IMHO, this is a clean and conventional way to deal with NPM packages. WDYT?
/cc @austinlparker