forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script and task to run PR checks locally
- Loading branch information
1 parent
379229a
commit bbbcd22
Showing
2 changed files
with
57 additions
and
3 deletions.
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
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,40 @@ | ||
#!/bin/bash | ||
|
||
# Function to run a command and check its status | ||
run_command() { | ||
echo "Running: '$1'" | ||
echo "----------------------------------------" | ||
$1 | ||
if [ $? -ne 0 ]; then | ||
echo "FAILURE: '$1'" | ||
exit 1 | ||
else | ||
echo "----------------------------------------" | ||
echo "SUCCESS: '$1'" | ||
echo "----------------------------------------" | ||
fi | ||
} | ||
|
||
# Check dependencies | ||
run_command "npm run checkDependencies" | ||
|
||
# Run linter | ||
run_command "npm run lint" | ||
|
||
# Check formatting | ||
run_command "npm run format-check" | ||
|
||
# Activate the virtual environment | ||
source ".venv/bin/activate" | ||
|
||
# Change directory to python_files | ||
cd python_files || exit | ||
|
||
# Run Pyright | ||
run_command "python -m pyright" | ||
|
||
# Run Ruff | ||
run_command "python -m ruff ." | ||
echo "----------------------------------------" | ||
echo "----------------------------------------" | ||
echo "All checks passed successfully!" |