Skip to content
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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

manas-yu
Copy link

@manas-yu manas-yu commented Oct 24, 2024

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

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

@manas-yu manas-yu requested a review from a team as a code owner October 24, 2024 08:26
@adhiamboperes adhiamboperes self-assigned this Oct 24, 2024
@manas-yu
Copy link
Author

@adhiamboperes PTAL, i will integrate the custom rules into scripts too.
please review and tell if there is anything else to do.

Copy link

oppiabot bot commented Nov 4, 2024

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.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 4, 2024
@manas-yu manas-yu marked this pull request as draft November 4, 2024 15:52
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 4, 2024
@manas-yu manas-yu marked this pull request as ready for review November 6, 2024 17:49
@manas-yu manas-yu requested a review from a team as a code owner November 6, 2024 17:49
@manas-yu
Copy link
Author

manas-yu commented Nov 6, 2024

@adhiamboperes The best solution to this issue seems to be creating a custom ruleset for KtLint. However, generating the custom rules JAR file will require running the command gradlew.bat :utility:customRulesJar as part of the script execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ktlint check comment block
2 participants