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

Replace removed constants with overridable methods #18517

Merged
merged 2 commits into from
Oct 8, 2024
Merged

Conversation

dduugg
Copy link
Member

@dduugg dduugg commented Oct 5, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

We should avoid remove_const, especially when redefining the removed const, as it violates normal assumptions of a "constant".

Surprisingly, there's no cop to disallow this method, except for the narrow case of specs. (There is an open issue for a general DisallowedMethods cop, which has some code snippets, should we want to bother with a custom rule.)

@dduugg
Copy link
Member Author

dduugg commented Oct 5, 2024

Needs to be merged in sync with Homebrew/homebrew-test-bot#1257 (or, on request, I can update the PR to dual-support constants and methods as an intermediate step.)

@dduugg dduugg changed the title Replace removable constants with overridable methods Replace removed constants with overridable methods Oct 6, 2024
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Makes sense to me! Keg::MUST_BE_WRITABLE_DIRECTORIES is used in brew test-bot so should stick around until it's fixed there first.

@MikeMcQuaid
Copy link
Member

or, on request, I can update the PR to dual-support constants and methods as an intermediate step.)

Yes, intermediate step will be necessary to get this merged 👍🏻

@dduugg dduugg force-pushed the no-rm_const branch 4 times, most recently from a0a1e13 to 4ef5fec Compare October 8, 2024 01:57
@dduugg
Copy link
Member Author

dduugg commented Oct 8, 2024

Updated PR to maintain dual support until Homebrew/homebrew-test-bot#1257 goes in

@dduugg dduugg merged commit 9753ede into master Oct 8, 2024
34 checks passed
@dduugg dduugg deleted the no-rm_const branch October 8, 2024 02:36
@dduugg dduugg mentioned this pull request Oct 8, 2024
7 tasks
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