-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: parse arg typing #36
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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 |
---|---|---|
|
@@ -39,4 +39,5 @@ yarn-error.log* | |
.DS_Store | ||
*.pem | ||
.vscode/ | ||
.eslintcache | ||
.eslintcache | ||
.idea/ |
This file contains 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 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 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 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 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,79 @@ | ||
#!/bin/bash | ||
|
||
# ANSI colour codes | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
NC='\033[0m' # No Colour | ||
|
||
# Function to print error messages | ||
print_error() { | ||
echo -e "${RED}[ERROR ] $1${NC}" | ||
} | ||
|
||
# Function to print success messages | ||
print_success() { | ||
echo -e "${GREEN}[SUCCESS] $1${NC}" | ||
} | ||
|
||
# Run initial commands | ||
pnpm lint:fix || { print_error "pnpm lint:fix failed"; exit 1; } | ||
pnpm lint || { print_error "pnpm lint failed"; exit 1; } | ||
pnpm build || { print_error "pnpm build failed"; exit 1; } | ||
pnpm format || { print_error "pnpm format failed"; exit 1; } | ||
pnpm format:check || { print_error "pnpm format:check failed"; exit 1; } | ||
|
||
# Change directory to packages | ||
cd packages || exit 1 | ||
|
||
# Variable to track API Extractor failures | ||
api_extractor_failure=0 | ||
|
||
# Loop through each folder that doesn't end with -config | ||
for dir in */; do | ||
if [[ ! $dir == *-config/ ]]; then | ||
echo "Processing $dir" | ||
( | ||
cd "$dir" || exit 1 | ||
pnpx @microsoft/api-extractor run --verbose | ||
) | ||
if [ $? -ne 0 ]; then | ||
print_error "api-extractor failed for $dir" | ||
api_extractor_failure=1 | ||
fi | ||
fi | ||
done | ||
|
||
if [ $api_extractor_failure -eq 0 ]; then | ||
print_success "All API Extractor operations completed successfully" | ||
else | ||
print_error "One or more API Extractor operations failed" | ||
exit 1 | ||
fi | ||
|
||
echo "----------------------------------------" | ||
echo "Checking package.json modifications:" | ||
echo "----------------------------------------" | ||
|
||
# Check if package.json has been modified in each relevant folder | ||
package_json_modified=0 | ||
for dir in */; do | ||
if [[ ! $dir == *-config/ ]]; then | ||
if git diff --quiet HEAD -- "$dir/package.json"; then | ||
echo -e "${RED}package.json in $dir has NOT been modified${NC}" | ||
else | ||
echo -e "${GREEN}package.json in $dir has been modified${NC}" | ||
package_json_modified=1 | ||
fi | ||
fi | ||
done | ||
|
||
if [ $package_json_modified -eq 0 ]; then | ||
print_error "No package.json was modified" | ||
exit 1 | ||
fi | ||
|
||
# If we've made it this far, all checks have passed | ||
echo "----------------------------------------" | ||
print_success "Pre-commit checks all succeeded!" | ||
echo "----------------------------------------" | ||
exit 0 |
Oops, something went wrong.
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.
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.
Quick callout here that
instanceof
checks whether the class is in the entire prototype chain, so:In any case this should get caught by
safeParse
, but just for awareness as there are some rare and esoteric prototype pollution scenarios, and making sure this isn't a hidden assumption.