From a72af2c8a66d556fdb4e65fbf2bfc22f2a163456 Mon Sep 17 00:00:00 2001 From: Claudia Date: Tue, 8 Jan 2019 08:13:25 +0100 Subject: [PATCH] Disable cop for #set_cpu_flags, #set_cpu_cflags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In `extend/ENV/std.rb`, the methods `set_cpu_flags` and `set_cpu_cflags` have been violating the `Naming/AccessorMethodName` cop. A recent modification in #7e13b3749 woke up the cop. That means we’re likely dealing with legacy code here, predating the introduction of RuboCop into Homebrew. This commit disables the cop for either method. I believe refactoring wouldn’t currently be worth the effort, especially given that `#set_cpu_cflags` is mostly called without arguments. --- Library/Homebrew/extend/ENV/std.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 68fedab6a1..ed0c2b4fc0 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -198,7 +198,7 @@ module Stdenv # Sets architecture-specific flags for every environment variable # given in the list `flags`. # @private - def set_cpu_flags(flags, map = Hardware::CPU.optimization_flags) + def set_cpu_flags(flags, map = Hardware::CPU.optimization_flags) # rubocop:disable Naming/AccessorMethodName cflags =~ /(-Xarch_#{Hardware::CPU.arch_32_bit} )-march=/ xarch = Regexp.last_match(1).to_s remove flags, /(-Xarch_#{Hardware::CPU.arch_32_bit} )?-march=\S*/ @@ -213,7 +213,7 @@ module Stdenv def x11; end # @private - def set_cpu_cflags(map = Hardware::CPU.optimization_flags) + def set_cpu_cflags(map = Hardware::CPU.optimization_flags) # rubocop:disable Naming/AccessorMethodName set_cpu_flags CC_FLAG_VARS, map end