-
Notifications
You must be signed in to change notification settings - Fork 4k
[NO QA] Fix 62656 lint changed #62993
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
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
18af2cf
intentionally create a useOnyx canBeMissing error
MacroLens 0d5685c
scripts: add lintChanged.sh
MacroLens eefdc1e
github-actions: lint-changed change depth to 30000
MacroLens 248e644
fix: change the checkout action to fetch further
MacroLens 05e2932
fix-wip: add fetch back
MacroLens bdc335c
scripts: lintChanged.sh fix style and clean logic
MacroLens 97005d0
scripts: lintChanged.sh unify style
MacroLens 4f9bc67
scripts: lintChanged.sh add CI/local checks
MacroLens 62eedc9
workflows: lint-changed: add commit count logic
MacroLens 005dc2e
workflows: lint-changed: shellcheck fixes
MacroLens b0b50e5
Revert "workflows: lint-changed: shellcheck fixes"
MacroLens 487aa6b
workflows: lint-changed: fix the shellcheck errors
MacroLens b99a4e0
workflows: lint-changed remove checkout condition
MacroLens 1028953
workflows: lint-changed.yml replace max logic
MacroLens f3be8ab
scripts: lintChanged.sh: handle large file count
MacroLens b90f49c
Use tag instead of app version for release link
roryabraham 1e48052
trigger workflows, will revert
MacroLens a1ea4f3
Revert "trigger workflows, will revert"
MacroLens 38564eb
apply suggestions
MacroLens b57c422
scripts: lintChanged: remove array logic
MacroLens 2dc41f4
Update .github/workflows/lint-changed.yml
MacroLens 7a15186
Apply suggestions from code review
MacroLens 5e3491e
scripts: lintChanged.sh: add newline EOF
MacroLens b7e99b0
Revert "intentionally create a useOnyx canBeMissing error"
MacroLens 5bfda6f
Merge remote-tracking branch 'upstream/main' into fix_62656_lint_changed
MacroLens 54addb8
Merge remote-tracking branch 'upstream/main' into fix_62656_lint_changed
MacroLens 03cf5d5
fix: scripts: lintChanged.sh: unshallow branch
MacroLens 6f37361
cspell config: Add unshallow to the words
MacroLens 18c3c6d
lint-changed: fix fetch-depth
MacroLens ca3f78d
Revert "cspell config: Add unshallow to the words"
MacroLens 8cc3ee0
Apply suggestions from code review
MacroLens db58cf1
workflows: lint-changed.yml: remove call to api
MacroLens 7f455f3
Merge remote-tracking branch 'upstream/main' into fix_62656_lint_changed
MacroLens 5b73da2
workflows: lint-changed: add comment to explain +2
MacroLens de2156f
workflows: lint-changed: add more detailed comment
MacroLens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Lints .ts and .tsx files that have changed in this branch | ||
|
|
||
| set -eu | ||
|
|
||
| TOP="$(realpath "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/..")" | ||
| readonly TOP | ||
| source "${TOP}/scripts/shellUtils.sh" | ||
|
|
||
| # Ensure this script is running inside an npm run context | ||
| if [[ -z "${npm_lifecycle_event:-}" ]]; then | ||
| info "Re-executing this script from an npm context" | ||
| exec npx -c "NODE_OPTIONS=--max_old_space_size=8192 ${BASH_SOURCE[0]} $*" | ||
| fi | ||
|
|
||
| # Fetch the commit history to include the merge-base commit | ||
| info "Fetching origin/main" | ||
| git fetch origin main --no-tags | ||
|
rafecolton marked this conversation as resolved.
|
||
|
|
||
| MERGE_BASE_SHA_HASH="$(git merge-base origin/main HEAD)" | ||
|
MacroLens marked this conversation as resolved.
|
||
| readonly MERGE_BASE_SHA_HASH | ||
|
|
||
| # Check if output is empty or malformed | ||
| if [[ -z "$MERGE_BASE_SHA_HASH" ]] || ! [[ "$MERGE_BASE_SHA_HASH" =~ ^[a-fA-F0-9]{40}$ ]]; then | ||
| error "git merge-base returned unexpected output: $MERGE_BASE_SHA_HASH" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Get the diff output and check status | ||
| if ! GIT_DIFF_OUTPUT="$(git diff --diff-filter=AMR --name-only "$MERGE_BASE_SHA_HASH" HEAD -- '*.ts' '*.tsx')"; then | ||
| error "git diff failed - output: $GIT_DIFF_OUTPUT" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Run eslint on the changed files | ||
| if [[ -n "$GIT_DIFF_OUTPUT" ]] ; then | ||
| # shellcheck disable=SC2086 # For multiple files in variable | ||
| eslint --max-warnings=0 --config ./.eslintrc.changed.js $GIT_DIFF_OUTPUT | ||
| else | ||
| info "No TypeScript files changed" | ||
| fi | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.