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 }