-
Notifications
You must be signed in to change notification settings - Fork 1
chore: add JetBrains auto-approval compliance linter #139
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
Conversation
Implements comprehensive linting to ensure compliance with JetBrains auto-approval requirements for Toolbox plugins. Features: - Shell script for JetBrains compliance checking - Detekt integration for code quality - GitHub Actions workflow for CI/CD - Comprehensive documentation Compliance checks: - Forbidden experimental API usage detection - Manual thread creation warnings - Java runtime hooks detection - Library bundling warnings - Coroutines best practices Based on clarified requirements from JetBrains team allowing: - coroutineScope.launch usage - Library-managed threads (with proper cleanup) - Some coroutines experimental APIs (select, onTimeout) Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
} | ||
|
||
// Configure detekt for code quality reporting | ||
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach { |
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.
Minor: we can do a static import here.
@@ -0,0 +1,102 @@ | |||
#!/bin/bash |
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.
any reason for not configuring the rules in a detekt.yml?
https://detekt.dev/docs/rules/style/#forbiddenannotation
Addresses PR feedback to use detekt's built-in rules instead of shell script: - Add comprehensive detekt.yml with JetBrains compliance rules - Use ForbiddenAnnotation for experimental API detection - Use ForbiddenMethodCall for runtime hooks and thread creation - Use ForbiddenImport for bundled library detection - Update GitHub Actions to use detekt for compliance checking - Update documentation to reflect detekt-based approach - Keep shell script as backup for manual verification Benefits: - More precise rule matching with detekt's AST analysis - Better integration with IDE and CI/CD - Detailed HTML reports with exact locations - Configurable severity levels and custom messages Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
🔄 Addressed PR FeedbackThanks for the great feedback @fioan89! I've updated the implementation to use detekt's built-in rules as suggested. ✅ Changes Made1. Added
|
The shell script is no longer needed since detekt.yml provides: - More accurate AST-based analysis vs regex patterns - Better IDE and CI/CD integration - Comprehensive HTML reports - Standard configuration format - Combined compliance + code quality checking Simplifies the implementation to use only detekt for all linting. Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
🧹 Cleanup: Removed Shell ScriptYou're absolutely right - the shell script was redundant! I've removed it and simplified the implementation. ✅ Why Remove the Script?The
🎯 Current ImplementationNow we have a clean, single-tool approach: # One command for everything:
./gradlew detekt This provides:
📊 Benefits
The implementation is now much cleaner and more robust! 🚀 |
🎯 JetBrains Auto-Approval Compliance Linter
This PR implements a comprehensive linting system to ensure compliance with JetBrains auto-approval requirements for Toolbox plugins.
📋 What's Included
1. JetBrains Compliance Check Script
scripts/jetbrains-compliance-check.sh
- Shell script for critical compliance checking2. Detekt Integration
build.gradle.kts
with reasonable defaults3. CI/CD Integration
.github/workflows/jetbrains-compliance.yml
4. Documentation
JETBRAINS_COMPLIANCE.md
- Comprehensive guide✅ Compliance Requirements Covered
Based on JetBrains team communication:
Forbidden (Critical Violations):
Allowed (With Guidance):
coroutineScope.launch
for concurrencyselect
,onTimeout
)CoderRemoteProvider#close()
🧪 Testing
Current Status:
$ ./scripts/jetbrains-compliance-check.sh ✅ No critical violations found! Your code appears to comply with JetBrains auto-approval requirements.
Code Quality:
🚀 Usage
Local Development:
CI/CD:
📝 Changes Made
build.gradle.kts
gradle/libs.versions.toml
with detekt version🔍 Review Notes
This ensures the plugin maintains JetBrains auto-approval status while providing helpful guidance to developers.
📊 Current Results
The current codebase shows:
RunnableActionDescription
interface usage (acceptable)Testing: ✅ Tested locally, compliance script passes
Documentation: ✅ Comprehensive docs included
CI/CD: ✅ GitHub Actions workflow ready
Breaking Changes: ❌ None - fully backward compatible