From 16a759dfd2fe1e9a4b61d556ff2990c6f212aacf Mon Sep 17 00:00:00 2001 From: Issy Long Date: Wed, 24 Jul 2024 23:34:10 +0100 Subject: [PATCH] Disable the new custom cop on CI so we can gradually fix formulae --- Library/.rubocop_ci.yml | 8 ++++++++ Library/Homebrew/style.rb | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 Library/.rubocop_ci.yml diff --git a/Library/.rubocop_ci.yml b/Library/.rubocop_ci.yml new file mode 100644 index 00000000000000..632e4cb49737ea --- /dev/null +++ b/Library/.rubocop_ci.yml @@ -0,0 +1,8 @@ +# Inherit from ./.rubocop.yml. +inherit_from: ./.rubocop.yml + +Homebrew/NoFileutilsRmrf: + Enabled: true + Include: + - "/**/Casks/**/*.rb" + - "**/Casks/**/*.rb" diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 7793f003e70c2b..a734a174a241bf 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -157,6 +157,11 @@ def self.run_rubocop(files, output_type, args << "--config" << (HOMEBREW_REPOSITORY/"docs/docs_rubocop_style.yml") elsif files.any? { |f| f.to_s.start_with? HOMEBREW_LIBRARY_PATH } base_dir = HOMEBREW_LIBRARY_PATH + # If we're in GitHub Actions, use the CI config. + # TODO: Remove this once we're done incrementally enabling new custom cops. + elsif GitHub::Actions.env_set? + args << "--config" << (HOMEBREW_LIBRARY/".rubocop_ci.yml") + base_dir = HOMEBREW_LIBRARY else args << "--config" << (HOMEBREW_LIBRARY/".rubocop.yml") base_dir = HOMEBREW_LIBRARY if files.any? { |f| f.to_s.start_with? HOMEBREW_LIBRARY }