Skip to content

Commit e01b5bd

Browse files
Update rubocop requirement from ~> 0.81.0 to ~> 1.28.2 (#248)
* Update rubocop requirement from ~> 0.81.0 to ~> 1.28.2 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](rubocop/rubocop@v0.81.0...v1.28.2) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * Enable all new Rubocop rules * Fix Rubocop warnings Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marat Radchenko <marat@slonopotamus.org>
1 parent 8531e78 commit e01b5bd

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
AllCops:
2+
NewCops: enable
23
TargetRubyVersion: 2.5
4+
Gemspec/RequireMFA:
5+
Enabled: false
36
Metrics/AbcSize:
47
Enabled: false
58
Metrics/BlockLength:
@@ -12,6 +15,8 @@ Layout/LineLength:
1215
Max: 120
1316
Metrics/MethodLength:
1417
Enabled: false
18+
Metrics/PerceivedComplexity:
19+
Enabled: false
1520
Style/StructInheritance:
1621
Enabled: false
1722
Style/Documentation:

bench.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# we can also repeat the code itself
1010
repeats = ARGV[1] ? ARGV[1].to_i : 1
1111

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

1414
puts "Benchmarking....\n"
1515
puts "Size: #{code.bytesize} bytes\n"

lib/pygments/popen.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Popen
1717
# Python process that talks to the Pygments library. We'll talk back and
1818
# forth across this pipe.
1919
def start(pygments_path = File.join(__dir__, '..', '..', 'vendor', 'pygments-main'))
20-
@log = Logger.new(ENV['MENTOS_LOG'] || File::NULL)
20+
@log = Logger.new(ENV.fetch('MENTOS_LOG', File::NULL))
2121
@log.level = Logger::INFO
2222
@log.datetime_format = '%Y-%m-%d %H:%M '
2323

@@ -323,11 +323,7 @@ def write_header(header, code)
323323
def get_timeout(timeout)
324324
return timeout unless timeout.nil?
325325

326-
begin
327-
Integer(ENV['MENTOS_TIMEOUT'])
328-
rescue TypeError
329-
0
330-
end
326+
Integer(ENV.fetch('MENTOS_TIMEOUT', 0))
331327
end
332328

333329
# Based on the header we receive, determine if we need

pygments.rb.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
2525
s.required_ruby_version = '>= 2.5.0'
2626

2727
s.add_development_dependency 'rake', '~> 13.0.0'
28-
s.add_development_dependency 'rubocop', '~> 0.81.0'
28+
s.add_development_dependency 'rubocop', '~> 1.28.2'
2929
s.add_development_dependency 'test-unit', '~> 3.5.0'
3030

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

0 commit comments

Comments
 (0)