Skip to content

Update rubocop requirement from ~> 0.81.0 to ~> 1.28.2 #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
AllCops:
NewCops: enable
TargetRubyVersion: 2.5
Gemspec/RequireMFA:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Expand All @@ -12,6 +15,8 @@ Layout/LineLength:
Max: 120
Metrics/MethodLength:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Style/StructInheritance:
Enabled: false
Style/Documentation:
Expand Down
2 changes: 1 addition & 1 deletion bench.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# we can also repeat the code itself
repeats = ARGV[1] ? ARGV[1].to_i : 1

code = File.open('test/test_pygments.rb').read.to_s * repeats
code = File.read('test/test_pygments.rb') * repeats

puts "Benchmarking....\n"
puts "Size: #{code.bytesize} bytes\n"
Expand Down
8 changes: 2 additions & 6 deletions lib/pygments/popen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Popen
# Python process that talks to the Pygments library. We'll talk back and
# forth across this pipe.
def start(pygments_path = File.join(__dir__, '..', '..', 'vendor', 'pygments-main'))
@log = Logger.new(ENV['MENTOS_LOG'] || File::NULL)
@log = Logger.new(ENV.fetch('MENTOS_LOG', File::NULL))
@log.level = Logger::INFO
@log.datetime_format = '%Y-%m-%d %H:%M '

Expand Down Expand Up @@ -323,11 +323,7 @@ def write_header(header, code)
def get_timeout(timeout)
return timeout unless timeout.nil?

begin
Integer(ENV['MENTOS_TIMEOUT'])
rescue TypeError
0
end
Integer(ENV.fetch('MENTOS_TIMEOUT', 0))
end

# Based on the header we receive, determine if we need
Expand Down
2 changes: 1 addition & 1 deletion pygments.rb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 2.5.0'

s.add_development_dependency 'rake', '~> 13.0.0'
s.add_development_dependency 'rubocop', '~> 0.81.0'
s.add_development_dependency 'rubocop', '~> 1.28.2'
s.add_development_dependency 'test-unit', '~> 3.5.0'

s.files = `git ls-files -z`.split("\0").reject { |f| File.symlink?(f) }
Expand Down