Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Formula-Cookbook: Stop recommending rm_f in postinstall #17965

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

issyl0
Copy link
Member

@issyl0 issyl0 commented Aug 4, 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?

- After all the work that went into
  #17705, we
  don't want the docs disagreeing with what CI says
  the style should be.
@issyl0 issyl0 force-pushed the formula-cookbook-stop-recommending-rmrf branch from 55b7079 to 768ef34 Compare August 4, 2024 23:10
@issyl0 issyl0 enabled auto-merge August 4, 2024 23:31
@issyl0 issyl0 merged commit 78132b1 into master Aug 4, 2024
24 checks passed
@issyl0 issyl0 deleted the formula-cookbook-stop-recommending-rmrf branch August 4, 2024 23:40
@@ -32,3 +32,7 @@ Style/RedundantRegexpArgument:
# Want to be able to display partial formulae in the docs.
Style/TopLevelMethodDefinition:
Enabled: false

# Formulae and Casks no longer use `rm_f`/`rm_rf`, so the docs need to match.
Lint/NonAtomicFileOperation:
Copy link
Member

Choose a reason for hiding this comment

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

Ideally we'd keep this around for mkdir_p.

Is this disabled/enabled in the other Homebrew .rubocop.yml file(s)? If so: should it be adjusted there too?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's enabled by default. But it only complained about this one when I removed the f.

Copy link
Member

Choose a reason for hiding this comment

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

I think that's because this is a non-atomic operation now. Particularly in post-install where we don't fully control the location: this is potentially problematic.

See: https://docs.rubocop.org/rubocop/cops_lint.html#lintnonatomicfileoperation

I think having this still enabled for mkdir_p but also having this be consistent everywhere would be desirable if possible.

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

Successfully merging this pull request may close these issues.

3 participants