-
Notifications
You must be signed in to change notification settings - Fork 527
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
Fix #3394: Ktlint Custom RuleSet #5558
Conversation
@adhiamboperes PTAL, i will integrate the custom rules into scripts too. |
Hi @manas-yu, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
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.
@manas-yu, after reviewing this solution, I do not think it is the best approach to solve this for now. Your solution proposes a custom Gradle integration, which is not ideal for two reasons:
- This won't work with Bazel, and we will soon remove Gradle in favor of Bazel. Move lintchecks to bazel #4106 proposes creating Bazel scripts for lint checks, to run in parallel with our existing custom Bash scripts until Gradle is removed.
- Integrate with ktfmt #2799 proposes using ktfmt, which is still pending invvestigation.
#3195 was created to track KDoc checks. Ben's comment was inconclusive on the approach (cc/ @jainv4156). It is my opinion that the two best options for this issue is:
- Use the existing script pattern to write a script that a)finds Kdocs and b)checks the Kdoc formatting.
- Investigate and do a writeup on Integrate with ktfmt #2799, e.g. Add support for Dagger Hilt [Blocked: #59] #1720 (comment), so we can make a decision on how to go about this.
Either way, I am closing this PR, and you can create a new. replacement once we have chosen a better approach. (Please feel free to use Discussions or the relevant issue thread to explore options.)
I encountered some issues with this approach, so i marked it as a draft to investigate further. If I find a more effective solution, I’ll open a new PR. |
Fix: #3394
This PR introduces two key features:
Custom Ruleset Provider: A new custom ruleset provider is implemented, allowing the integration of custom Ktlint rules.
KDocFormatRule: The
KDocFormatRule
is added to enforce correct closing syntax in KDoc comments.To create the JAR file for the custom ruleset:
gradlew.bat :utility:customRulesJar
Use the custom ruleset with Ktlint by executing:
ktlint --ruleset=../oppia-android-tools/custom-ktlint-rules.jar "path/to/file"
Essential Checklist