Enable more rubocop cops (#9980)

* Remove self.check in python3.rb as tests were not actuallly being run

* Enable Lint/ImplicitStringConcatenation cop

* Enable Layout/CommentIndentation cop

* Remove unnecessary configuration of Layout/IndentationStyle to EnforcedStyle: spaces, as this is already the default

* Enable Layout/LeadingCommentSpace cop

* Enable Layout/SpaceInsideBlockBraces cop

* Enable Layout/SpaceInsideParens cop

* Enable Layout/TrailingEmptyLines cop

* Enable Lint/LiteralAsCondition cop

* Document the current issue stopping us from enabling Style/OptionalBooleanParameter

* Stop downloading our rubocop config when installing ruby_rubocop
This commit is contained in:
Maximilian Downey Twiss
2024-06-18 06:19:11 +10:00
committed by GitHub
parent fcb36066e2
commit 33901368d7
27 changed files with 54 additions and 118 deletions

View File

@@ -19,7 +19,7 @@ class Autotools < Package
end
abort 'configure script not found!'.lightred unless File.file?('configure')
FileUtils.chmod('+x', 'configure')
if `grep -q /usr/bin/file configure`
if system('grep -q /usr/bin/file configure')
puts 'Using filefix.'.orange
system 'filefix'
end

View File

@@ -20,7 +20,7 @@ class Pip < Package
@py_pkg_deps = @py_pkg_versioned_pypi_hash['info']['requires_dist']
# We don't want extra packages listed in the dependency list, since
# those are optional.
@py_pkg_deps.reject! {|x| x.include?('extra ==')} unless @py_pkg_deps.to_s.empty?
@py_pkg_deps.reject! { |x| x.include?('extra ==') } unless @py_pkg_deps.to_s.empty?
unless @py_pkg_deps.to_s.empty?
puts "Installing #{@py_pkg} python dependencies with pip...".orange
@py_pkg_deps.each do |pip_dep|

View File

@@ -4,14 +4,14 @@ class Python < Package
property :python_build_options, :python_install_options, :python_install_extras, :no_svem
def self.build
#@required_pip_modules = %w[build installer setuptools wheel pyproject_hooks]
#@pip_list = `pip list --exclude pip`
#@required_pip_modules.each do |pip_pkg|
#unless @pip_list.include?(pip_pkg)
#puts "Installing #{pip_pkg} using pip..."
#system "MAKEFLAGS=-j#{CREW_NPROC} pip install #{pip_pkg}"
#end
#end
# @required_pip_modules = %w[build installer setuptools wheel pyproject_hooks]
# @pip_list = `pip list --exclude pip`
# @required_pip_modules.each do |pip_pkg|
# unless @pip_list.include?(pip_pkg)
# puts "Installing #{pip_pkg} using pip..."
# system "MAKEFLAGS=-j#{CREW_NPROC} pip install #{pip_pkg}"
# end
# end
if File.file?('setup.py')
puts "Python build options being used: #{PY3_SETUP_BUILD_OPTIONS} #{@python_build_options}".orange
system "MAKEFLAGS=-j#{CREW_NPROC} python3 setup.py build #{PY3_SETUP_BUILD_OPTIONS} #{@python_build_options}"