Repository navigation
chore: fix precommit for eslint - #32596
Conversation
There was a problem hiding this comment.
I've completed my review and didn't find any issues.
Need a new review? Comment
/korbit-reviewon this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-reviewcommand in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-descriptioncommand in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolvecommand in any comment on your PR.- On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ❌ Issue Categories
Category Enabled Documentation ✅ Logging ✅ Error Handling ✅ Readability ✅ Design ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
Note
Korbit Pro is free for open source projects 🎉
Looking to add Korbit to your team? Get started with a free 2 week trial here
|
@rusackas since you mentioned that this didn't work for you in the past, wondering if you can pull/test this and report back. Also remembering some issues with a user that was using Linux, where it's possible that I don't have a linux VM laying around to test... Would love if someone can test on Linux. |
|
I'll test and report back asap. Would love to get this speedy again. |
| args: ["--markdown-linebreak-ext=md"] | ||
| - repo: local | ||
| - repo: https://github.com/pre-commit/mirrors-prettier | ||
| rev: v4.0.0-alpha.8 # Use the sha or tag you want to point at |
There was a problem hiding this comment.
We're using 3.3.3 on the repo. I wonder if that'll lead to trouble.
There was a problem hiding this comment.
Oh wait, I see it uses prettier 3.3.3 below... but this repo is archived and claims it was broken by newer versions of Prettier. Not sure what to make of that yet.
There was a problem hiding this comment.
Yeah that's the ref o the GHA repo. Looks like the latest -> https://github.com/pre-commit/mirrors-prettier/tags
There was a problem hiding this comment.
Wasn't sure how much to worry about "This repository was archived by the owner on Apr 11, 2024. It is now read-only." - I guess it might be there forever, but someone could go sweeping up one day.
There was a problem hiding this comment.
Yeah seems it'd be good hygiene to get rid of this GHA-as-a-submodule and simply git push ourselves in our action. I don't think we need a reference to an unmaintained/super-simple GHA here given the use case.
| files: ^superset-frontend/.*\.(js|jsx|ts|tsx)$ | ||
| - id: eslint-docs | ||
| name: eslint (docs) | ||
| entry: bash -c 'cd docs && FILES=$(echo "$@" | sed "s|docs/||g") && yarn eslint --ext .js,.jsx,.ts,.tsx --quiet $([ -z "$SKIP_FIX" ] && echo "--fix") $FILES' |
There was a problem hiding this comment.
I think we're getting rid of SKIP_FIX?
There was a problem hiding this comment.
Yes, unless I'm missing something I think it's fair to assume that pre-commit tries and fix things. Personally I've never seen prettier or eslint make a bad fix, meaning it's pretty much always preferable to --fix.
If I remember well there's something in the pre-commit GHA that checks if the code's been altered and fails if/when that's the case. I think the return code is negative regardless, but we're still checking to see if anything changed and fail if that's the case. Here: https://github.com/apache/superset/blob/master/.github/workflows/pre-commit.yml#L69-L72
There was a problem hiding this comment.
Ahh, what I meant is that if SKIP_FIX is no longer in pre-commit.yaml as of this PR, I think we can remove it from this line.
| set +e # Don't exit immediately on failure | ||
| # Skip auto-fixing in CI to ensure changes are committed locally | ||
| export SKIP_FIX=1 | ||
| export SKIP=eslint-frontend,type-checking-frontend |
There was a problem hiding this comment.
I think SKIP_FIX was introduced in your previous PR and isn't referenced anywhere else in the repo after this PR.
SKIP is used for pre-commit steps that are already handled in other GHAs, in this case those 2 are handled in the superset-frontend GHA.
There was a problem hiding this comment.
Ahh, ok, I wasn't understanding what SKIP did, but SKIP_FIX being removed here means we can remove it in pre-commit-config.yml as well, then.
Fine by me! It seems to just roll back the parts I wasn't really hoping to touch much in the first place :D The things I set out to do which still seem to be in effect here are:
With this change, we lose two things, which maybe we can fix here or in subsequent PR(s):
Otherwise, just a couple of loose ends in the code to contend with in threads above. |
From my understanding it's still here -> https://github.com/apache/superset/pull/32596/files#diff-63a9c44a44acf85fea213a857769990937107cf072831e1a26808cfde9d096b9R77-R83
Can add |
|
Here, added --fix -> ac7fd7e |
|
Thanks for Once the last remnant of I'll tackle TS checking in a separate PR (it'd be nice, but not blocking this) Up to you if you want to ditch that archived GHA inclusion or not for this PR, or handle that separately. More of a TODO than a blocker. |
|
Ok removed the last |
…nt the full changelog file Comparing changelog.py's output with the published 6.0.0 and 6.1.0 changelogs showed several problems: - A commit made with `git revert` has the subject `Revert "... (#N)"` and no PR number of its own, so it was read as PR #N again. 6.1.0's changelog lists apache#38846 twice although it was reverted on the 6.1 branch, and because apache#38846 appears in 6.1.0's history, the 7.0.0 changelog left it out although 7.0 includes it. Each PR's state is now worked out from its commits in order: reverted PRs are left out, and reverting a revert lands the PR again. - PRs merged more than once were listed once per merge (apache#31998, apache#32596 and apache#33205 in 6.0.0's changelog). They're listed once. - Logins were looked up by git author name, using the first PR seen for that name, so one person's revert of another's PR credited all of the reverter's later PRs to the other person. Each PR is credited to its own author. - The heading named the git ref (`### 6.0` in 6.0.0's changelog), and release managers added the license header, `## Change Log` and blank lines by hand. The command prints the complete CHANGELOG/<version>.md file, naming --release_version or SUPERSET_VERSION in the heading, and sends its progress output to stderr. A PR GitHub no longer serves is listed with its commit author's login and its subject without the `(#N)` suffix, so it needs no hand edits.
Trying to fix prettier and eslint in pre-commit so it only runs on altered files.
@rusackas this works for me, but is largely a rollback of #32352 in some key areas. Wondering what's wrong here.
Changes:
scripts/eslint.shIf this doesn't work in some cases I can try and address the core issues.