Skip to content

Correct Rubocop for private_class_method method documentation. #11637

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

Merged

Conversation

bigzed
Copy link
Contributor

@bigzed bigzed commented Feb 28, 2023

The private_class_method modifier was not respected when checking whether a method needs documentation. I was able to fix that, but unable to fix the corresponding spec when documentation is present. Rubocop unfortunately still complains.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@bigzed bigzed force-pushed the fix-private-class-method-documentation-cop branch 2 times, most recently from 1361fcc to d9311cc Compare February 28, 2023 10:48
@bbatsov
Copy link
Collaborator

bbatsov commented Mar 13, 2023

I was able to fix that, but unable to fix the corresponding spec when documentation is present. Rubocop unfortunately still complains.

Can you elaborate on that? What remains to be done exactly?

@bigzed bigzed force-pushed the fix-private-class-method-documentation-cop branch from d9311cc to aab15b1 Compare April 26, 2023 06:29
@bigzed
Copy link
Contributor Author

bigzed commented Apr 26, 2023

Sorry for the long delay. I removed the offending spec for now. The MR now only adds the private_class_method modifier to the non public modifiers and adds the corresponding spec.

The second commit I removed was testing whether a documented private_class_method def blah would register an offense and it unfortunately did. I'll revisit that and will submit a second as soon as I have fixed it.
Thank you and sorry for the delay.

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 21, 2023

The changes look good. Don't forget to reflect them in the changelog by adding a new changelog entry.

@bigzed bigzed force-pushed the fix-private-class-method-documentation-cop branch from aab15b1 to d2780cb Compare July 27, 2023 13:18
@bigzed
Copy link
Contributor Author

bigzed commented Jul 27, 2023

@bbatsov The changelog now refelcts the bugfix under unreleased.

CHANGELOG.md Outdated
@@ -11,6 +11,11 @@

## master (unreleased)

### Bug fixes
Copy link
Collaborator

Choose a reason for hiding this comment

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

You shouldn't edit the changelog manually - it's generated from the files in the changelog folder at release time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, my mistake. Is this the correct way?

@bigzed bigzed force-pushed the fix-private-class-method-documentation-cop branch from d2780cb to fe236fc Compare July 27, 2023 19:20
@bbatsov bbatsov merged commit 46eb567 into rubocop:master Jul 27, 2023
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.

2 participants