diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e1468bdfc2ad..a5dedb4b8d40 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,9 +12,7 @@ "type": "npm", "script": "compile", "isBackground": true, - "problemMatcher": [ - "$tsc-watch" - ], + "problemMatcher": ["$tsc-watch"], "group": { "kind": "build", "isDefault": true @@ -34,6 +32,22 @@ "script": "preTestJediLSP", "problemMatcher": [], "label": "preTestJediLSP" + }, + { + "label": "Run checkPR.sh", + "type": "shell", + "command": "${workspaceFolder}/scripts/checkPR.sh", + "group": { + "kind": "build", + "isDefault": false + }, + "problemMatcher": [], + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared" + } } ] } diff --git a/scripts/checkPR.sh b/scripts/checkPR.sh new file mode 100755 index 000000000000..3329c756cc6c --- /dev/null +++ b/scripts/checkPR.sh @@ -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!"