Run all quality checks for the current project: lint, checkstyle, static analysis (SonarQube if available), unit tests, and integration tests.
Run each step in order. Report results clearly after each phase. If a phase fails, show the relevant error output and stop — do not proceed to the next phase.
if [ -f "./gradlew" ]; then
echo "BUILD_SYSTEM=gradle"
elif [ -f "pom.xml" ]; then
echo "BUILD_SYSTEM=maven"
elif [ -f "package.json" ]; then
echo "BUILD_SYSTEM=npm"
else
echo "BUILD_SYSTEM=unknown"
fiGradle:
./gradlew checkstyleMain checkstyleTest forbiddenApisMaven:
mvn checkstyle:checknpm:
npm run lintGradle:
./gradlew testMaven:
mvn testnpm:
npm test -- --watchAll=falseCheck whether SonarQube is configured in the project:
# Gradle: look for sonarqube plugin or sonar-project.properties
grep -r "sonarqube\|id.*sonar" build.gradle buildSrc/ --include="*.gradle" --include="*.kts" -l 2>/dev/null | head -3
ls sonar-project.properties 2>/dev/nullIf sonar is configured, run:
Gradle:
./gradlew sonaror
./gradlew sonarqubeMaven:
mvn sonar:sonarIf SonarQube is not configured locally, skip this step and note it in the summary.
Gradle:
./gradlew integrationTestMaven:
mvn verify -P integration-testsnpm:
npm run test:integrationℹ️ Integration tests may require Docker (databases, WireMock). If they fail due to missing infrastructure, report the error and mark this step as skipped.
After all steps, output a summary table:
| Phase | Status | Notes |
|---|---|---|
| Lint & Checkstyle | ✅/❌ | |
| Unit tests | ✅/❌ | |
| SonarQube | ✅/❌/⏭ | |
| Integration tests | ✅/❌/⏭ |
Use ⏭ (skipped) when a step was skipped due to missing config or infrastructure.