eslint icon indicating copy to clipboard operation
eslint copied to clipboard

chore: migrate linting workflow to use trunk check metalinter

Open EliSchleifer opened this issue 1 year ago • 21 comments

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update [ ] Bug fix (template) [ ] New rule (template) [ ] Changes an existing rule (template) [ ] Add autofix to a rule [ ] Add a CLI option [ ] Add something to the core [x ] Other, please explain: chore to migrate linting solution to trunk check - universal metalinter

What changes did you make? (Give an overview)

Trunk is a universal meta-linter and therefore obfuscates the need for separate calls to markdownlint / eslint / etc...

  • Removed markdownlintignore (trunk by default ignores all files in .gitignore and added separately ignore of changelog.md to trunk.yaml)
  • All tools will run in batch mode where possible (eslint, markdownlint, svgo)

I've left in place the current git-hook implementation. I want to make sure the basic ergonomics work before migrating these scripts into trunk actions as well.

Is there anything you'd like reviewers to focus on?

Make sure you like the ergonomics of the tool as currently integrated

EliSchleifer avatar Dec 19 '23 07:12 EliSchleifer

Hi @EliSchleifer!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The length of the commit message must be less than or equal to 72

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Dec 19 '23 07:12 eslint-github-bot[bot]

CLA Not Signed

Deploy Preview for docs-eslint ready!

Name Link
Latest commit f47ca8583fb519744509a151ee8aef010ddb9254
Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/65f36c9a6733200008a92b56
Deploy Preview https://deploy-preview-17876--docs-eslint.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Dec 19 '23 07:12 netlify[bot]

Hi @EliSchleifer!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase
  • The length of the commit message must be less than or equal to 72

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Dec 19 '23 07:12 eslint-github-bot[bot]

Thanks for putting this together. It looks like the CI is failing with a message "trunk not found". Is there a way to get this working in CI to see what the output looks like?

We're working on getting our v9.0.0 alpha out this week, so will have more time to investigate this next week.

nzakas avatar Dec 27 '23 19:12 nzakas

Will get that fixed. I’m on vacation till end of the week


From: Nicholas C. Zakas @.> Sent: Wednesday, December 27, 2023 11:06:22 AM To: eslint/eslint @.> Cc: Eli Schleifer @.>; Mention @.> Subject: Re: [eslint/eslint] chore: migrate linting workflow to use trunk check metalinter (PR #17876)

Thanks for putting this together. It looks like the CI is failing with a message "trunk not found". Is there a way to get this working in CI to see what the output looks like?

We're working on getting our v9.0.0 alpha out this week, so will have more time to investigate this next week.

— Reply to this email directly, view it on GitHubhttps://github.com/eslint/eslint/pull/17876#issuecomment-1870558345, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJVCPVJGWDYDW6UV4GCXBLYLRWS5AVCNFSM6AAAAABA2WKCSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZQGU2TQMZUGU. You are receiving this because you were mentioned.Message ID: @.***>

EliSchleifer avatar Dec 29 '23 04:12 EliSchleifer

@nzakas - I think this cleans up all the issues and at least let's you kick tires completely. I didn't see an active GitHub action that ran ESLint on itself - is the lint step right now fully optional?

I can add a trunk check step that would automatically run check on each PR and make sure all rules are being followed.

EliSchleifer avatar Jan 09 '24 17:01 EliSchleifer

Because you're a first-time contributor, the lint check doesn't run automatically -- I just manually approved it so it will run now. It's titled "Verify Files" in the actions list.

nzakas avatar Jan 09 '24 18:01 nzakas

I've tried checking this out locally and on my Windows machine I'm getting the following:

$ npm run trunk

> [email protected] trunk
> trunk

The system cannot find the path specified.

I tried running npm install, but it seems that doesn't help. Does trunk work on Windows? Is there something else I need to do get it to work locally?

nzakas avatar Jan 11 '24 18:01 nzakas

I've tried checking this out locally and on my Windows machine I'm getting the following:

$ npm run trunk

> [email protected] trunk
> trunk

The system cannot find the path specified.

I tried running npm install, but it seems that doesn't help. Does trunk work on Windows? Is there something else I need to do get it to work locally?

The product does work on windows - but not sure we've tested the npm flow - I am not a node/windows expert - but we have those on staff. They're taking a look.

EliSchleifer avatar Jan 11 '24 19:01 EliSchleifer

two issues here:

  1. I mistakenly changed call to trunk check from CI even though trunk was not on the path - so moved to use npm run
  2. You uncovered a bug in our launcher for windows - having someone from the team fix that up. @nzakas - do you use powershell on your windows box or bash emulation?

EliSchleifer avatar Jan 11 '24 22:01 EliSchleifer

I'm using Git Bash.

nzakas avatar Jan 16 '24 20:01 nzakas

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Jan 26 '24 22:01 github-actions[bot]

@EliSchleifer looks like we have the CI failing again on this.

nzakas avatar Feb 06 '24 17:02 nzakas

on it - also looking into how we can better support the mode of running on docs only in CI and not locally. small product change to make that a better experience and map to what we're aiming for here

@EliSchleifer looks like we have the CI failing again on this.

EliSchleifer avatar Feb 06 '24 23:02 EliSchleifer

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Feb 17 '24 22:02 github-actions[bot]

hi @EliSchleifer, you can share the updates regarding this PR or if it is ready to review.

Tanujkanti4441 avatar Feb 18 '24 13:02 Tanujkanti4441

I need to update the config - so the verification step is properly modeling the desire to handle CI flow differently from PR local flow. I should be able to update it this week

EliSchleifer avatar Feb 20 '24 04:02 EliSchleifer

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Mar 08 '24 22:03 github-actions[bot]

Got a plan to make this work beautifully. Will post update tomorrow morning


From: Joel Mathew Koshy @.> Sent: Wednesday, March 13, 2024 7:19:07 PM To: eslint/eslint @.> Cc: Eli Schleifer @.>; Mention @.> Subject: Re: [eslint/eslint] chore: migrate linting workflow to use trunk check metalinter (PR #17876)

@Rec0iL99 commented on this pull request.


In .github/workflows/ci.ymlhttps://github.com/eslint/eslint/pull/17876#discussion_r1524119578:

@@ -33,9 +33,6 @@ jobs: - name: Check Licenses run: node Makefile checkLicenses

    • name: Lint Docs JS Files

ping @EliSchleiferhttps://github.com/EliSchleifer

— Reply to this email directly, view it on GitHubhttps://github.com/eslint/eslint/pull/17876#discussion_r1524119578, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJVCPQ3LQQPFRPJPRPQOZ3YYECJXAVCNFSM6AAAAABA2WKCSOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSMZVGUZDSMJVGQ. You are receiving this because you were mentioned.Message ID: @.***>

EliSchleifer avatar Mar 14 '24 03:03 EliSchleifer

@EliSchleifer there are merge conflicts. Can you take a look?

fasttime avatar May 01 '24 18:05 fasttime

I have opened a new PR here: https://github.com/eslint/eslint/pull/18643

det avatar Jul 01 '24 21:07 det

I have opened a new PR here: #18643

Thanks @det! I'm going to close this PR in favor of the new one (and thanks @EliSchleifer for the initial work).

fasttime avatar Jul 02 '24 05:07 fasttime