Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
blink-so wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromfeat/jetbrains-compliance-linter

Conversation

blink-so[bot]
Copy link

🎯 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 checking
  • Detects forbidden experimental APIs, runtime hooks, manual thread creation
  • Based on clarified requirements from JetBrains team
  • Exits with error on critical violations

2.Detekt Integration

  • Added detekt Kotlin linter for code quality
  • Configured inbuild.gradle.kts with reasonable defaults
  • Generates HTML reports for detailed analysis
  • Runs without failing build (reports only)

3.CI/CD Integration

  • GitHub Actions workflow.github/workflows/jetbrains-compliance.yml
  • Runs compliance checks on every PR and push
  • Fails build on critical compliance violations
  • Comments on PRs when issues are found

4.Documentation

  • JETBRAINS_COMPLIANCE.md - Comprehensive guide
  • Usage instructions and troubleshooting
  • Maintenance procedures

✅ Compliance Requirements Covered

Based on JetBrains team communication:

Forbidden (Critical Violations):

  • ❌ Core Kotlin experimental APIs
  • ❌ Java runtime hooks (shutdown hooks, security manager, etc.)
  • ❌ Bundling libraries already provided by Toolbox
  • ❌ Ill-intentioned actions

Allowed (With Guidance):

  • coroutineScope.launch for concurrency
  • ✅ Library-managed threads (OkHttp, etc.) with proper cleanup
  • ✅ Some coroutines experimental APIs (select,onTimeout)
  • ✅ Resource cleanup inCoderRemoteProvider#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:

$ ./gradlew detekt# Reports code quality issues (non-blocking)# HTML report available at build/reports/detekt/detekt.html

🚀 Usage

Local Development:

# Quick compliance check./scripts/jetbrains-compliance-check.sh# Full code quality check./gradlew detekt

CI/CD:

  • Compliance checks run automatically on PR/push
  • Build fails on critical violations
  • Code quality issues are reported but don't fail build

📝 Changes Made

  • Added detekt dependency and configuration tobuild.gradle.kts
  • Updatedgradle/libs.versions.toml with detekt version
  • Created compliance check script with JetBrains-specific rules
  • Set up GitHub Actions workflow for automated checking
  • Added comprehensive documentation

🔍 Review Notes

  1. Script Accuracy: The compliance script is based on the actual JetBrains team communication provided
  2. Non-Breaking: Existing code passes all critical compliance checks
  3. Developer-Friendly: Clear error messages and guidance provided
  4. Maintainable: Well-documented and easy to update as requirements change

This ensures the plugin maintains JetBrains auto-approval status while providing helpful guidance to developers.

📊 Current Results

The current codebase shows:

  • 0 critical violations - fully compliant with JetBrains requirements
  • 1 minor warning -RunnableActionDescription interface usage (acceptable)
  • Ready for auto-approval - all requirements met

Testing: ✅ Tested locally, compliance script passes
Documentation: ✅ Comprehensive docs included
CI/CD: ✅ GitHub Actions workflow ready
Breaking Changes: ❌ None - fully backward compatible

Implements comprehensive linting to ensure compliance with JetBrainsauto-approval requirements for Toolbox plugins.Features:- Shell script for JetBrains compliance checking- Detekt integration for code quality- GitHub Actions workflow for CI/CD- Comprehensive documentationCompliance checks:- Forbidden experimental API usage detection- Manual thread creation warnings- Java runtime hooks detection- Library bundling warnings- Coroutines best practicesBased 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>
@matifalimatifali changed the titlefeat: Add JetBrains auto-approval compliance linterchore: add JetBrains auto-approval compliance linterJun 27, 2025
}

// Configure detekt for code quality reporting
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
Copy link
Collaborator

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
Copy link
Collaborator

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fioan89fioan89fioan89 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@fioan89

[8]ページ先頭

©2009-2025 Movatter.jp