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 #3304: Add check to ensure KDoc presence for non-private members #3499

Merged
merged 203 commits into from
Jul 30, 2021

Conversation

Sparsh1212
Copy link
Contributor

@Sparsh1212 Sparsh1212 commented Jul 17, 2021

Explanation

Fixes #3304: Add check to ensure KDoc presence for non-private members

Script for ensuring that KDocs are present on all non-private:

  • Classes
  • Functions
  • Values/fields
  • Explicit constructors
  • Companion objects
  • Nested classes
  • Enums
  • Annotations
  • Interfaces

Note: If any of the above member has an override modifier present, then it is automatically
exempted for the KDoc check.

Usage:
bazel run //scripts:kdoc_check -- <path_to_directory_root>

Arguments:

  • path_to_directory_root: directory path to the root of the Oppia Android repository.

Example:
bazel run //scripts:kdoc_check -- $(pwd)

For testing the script, automated tests have been added.
To execute the tests, use:

bazel test //scripts/src/javatests/org/oppia/android/scripts/kdoc:KDocCheckTest

Note: We are generating the test assets dynamically at the time of executing them. The test assets are automatically deleted when the test finishes.

SS when the CI check fails:

image

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Sparsh1212! I think this looks really great--the test name changes make them much clearer, I think.

I just noticed one comment didn't seem resolved, but I otherwise have nothing new to add.

Could you please fix the deltas on this PR & its title since #3352 was merged?

@BenHenning BenHenning assigned Sparsh1212 and unassigned BenHenning Jul 30, 2021
@Sparsh1212
Copy link
Contributor Author

Thanks @Sparsh1212! I think this looks really great--the test name changes make them much clearer, I think.

I just noticed one comment didn't seem resolved, but I otherwise have nothing new to add.

Could you please fix the deltas on this PR & its title since #3352 was merged?

Thanks @BenHenning the PR is now updated and the one left a comment is also addressed. PTAL.
Also assigning to @anandwana001 for a pass.

@Sparsh1212 Sparsh1212 changed the title Fix #3304: Add check to ensure KDoc presence for non-private members [Blocked on: #3352] Fix #3304: Add check to ensure KDoc presence for non-private members Jul 30, 2021
@Sparsh1212 Sparsh1212 removed their assignment Jul 30, 2021
@Sparsh1212 Sparsh1212 added the PR don't merge - NEEDS UPDATE Corresponds to PRs that need to be updated with the latest develop changes before they can be merged label Jul 30, 2021
@Sparsh1212 Sparsh1212 removed the PR don't merge - NEEDS UPDATE Corresponds to PRs that need to be updated with the latest develop changes before they can be merged label Jul 30, 2021
Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Sparsh1212
Took a quick pass on this. Left few suggestions. Also, please check on failing actions.

@Sparsh1212
Copy link
Contributor Author

Sparsh1212 commented Jul 30, 2021

Thanks @Sparsh1212
Took a quick pass on this. Left few suggestions. Also, please check on failing actions.

Thanks, @anandwana001 followed up on all the suggestions. PTAL.

@Sparsh1212 Sparsh1212 removed their assignment Jul 30, 2021
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Sparsh1212! LGTM.

@BenHenning BenHenning removed their assignment Jul 30, 2021
Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anandwana001 anandwana001 merged commit 5c57dd8 into develop Jul 30, 2021
@anandwana001 anandwana001 deleted the kdoc-check branch July 30, 2021 10:40
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.

Create a Kotlin script to ensure the presence of KDoc for every non-private declaration.
5 participants