From 768ef34bc2c3d98cd00127a170120a65097ae6e4 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sun, 4 Aug 2024 23:57:49 +0100 Subject: [PATCH] Formula-Cookbook: Stop recommending `rm_f` in `postinstall` - After all the work that went into https://github.com/Homebrew/brew/pull/17705, we don't want the docs disagreeing with what CI says the style should be. --- docs/.rubocop.yml | 4 ++++ docs/Formula-Cookbook.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/.rubocop.yml b/docs/.rubocop.yml index 1c984c707e2de..ca79d9e6ed746 100644 --- a/docs/.rubocop.yml +++ b/docs/.rubocop.yml @@ -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: + Enabled: false diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md index e037f01d61ccb..3883964384ffb 100644 --- a/docs/Formula-Cookbook.md +++ b/docs/Formula-Cookbook.md @@ -995,7 +995,7 @@ class Foo < Formula url "https://example.com/foo-1.0.tar.gz" def post_install - rm_f pkgetc/"cert.pem" + rm pkgetc/"cert.pem" if File.exist?(pkgetc/"cert.pem") pkgetc.install_symlink Formula["ca-certificates"].pkgetc/"cert.pem" end # ...