Merge pull request #7353 from MikeMcQuaid/rubocops-more
More RuboCops fixes
This commit is contained in:
commit
9add43e6a4
9
.github/workflows/tests.yml
vendored
9
.github/workflows/tests.yml
vendored
@ -125,9 +125,16 @@ jobs:
|
||||
brew update-test --commit=HEAD
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
- name: Run brew readall
|
||||
- name: Run brew readall on all taps
|
||||
run: brew readall --aliases
|
||||
|
||||
- name: Run brew style on homebrew-core
|
||||
if: matrix.os == 'macOS-latest'
|
||||
run: brew style --display-cop-names homebrew/core
|
||||
|
||||
- name: Run brew style on official taps
|
||||
run: brew style --display-cop-names homebrew/bundle homebrew/services homebrew/test-bot
|
||||
|
||||
- name: Run vale for docs linting
|
||||
run: |
|
||||
brew install vale
|
||||
|
@ -240,18 +240,18 @@ module RuboCop
|
||||
# Avoid hard-coding compilers
|
||||
find_every_method_call_by_name(body_node, :system).each do |method|
|
||||
param = parameters(method).first
|
||||
if match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)[\s"]?})
|
||||
if match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)(\s|$)})
|
||||
problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{match[2]}\""
|
||||
elsif match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)[\s"]?})
|
||||
elsif match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)(\s|$)})
|
||||
problem "Use \"\#{ENV.cxx}\" instead of hard-coding \"#{match[2]}\""
|
||||
end
|
||||
end
|
||||
|
||||
find_instance_method_call(body_node, "ENV", :[]=) do |method|
|
||||
param = parameters(method)[1]
|
||||
if match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)[\s"]?})
|
||||
if match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)(\s|$)})
|
||||
problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{match[2]}\""
|
||||
elsif match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)[\s"]?})
|
||||
elsif match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)(\s|$)})
|
||||
problem "Use \"\#{ENV.cxx}\" instead of hard-coding \"#{match[2]}\""
|
||||
end
|
||||
end
|
||||
|
@ -54,6 +54,7 @@ module RuboCop
|
||||
|
||||
find_method_with_args(body_node, :system, "dep", "ensure") do |d|
|
||||
next if parameters_passed?(d, /vendor-only/)
|
||||
next if @formula_name == "goose" # needed in 2.3.0
|
||||
|
||||
problem "use \"dep\", \"ensure\", \"-vendor-only\""
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user