Skip to content

Commit 68c14fe

Browse files
committed
Fix Rubocop warnings
1 parent df2e466 commit 68c14fe

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
matrix:
2323
ruby: [ 'jruby-9.2', '2.5', '3.1' ]
2424
python: [ '3.6', '3.11' ]
25-
platform: [ ubuntu-20.04, macos-latest, windows-2019 ]
25+
platform: [ ubuntu-20.04, ubuntu-22.04, macos-latest, windows-2019 ]
2626
runs-on: ${{ matrix.platform }}
2727
steps:
2828
- name: Checkout

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
AllCops:
22
NewCops: enable
33
TargetRubyVersion: 2.5
4+
Gemspec/RequireMFA:
5+
Enabled: false
46
Metrics/AbcSize:
57
Enabled: false
68
Metrics/BlockLength:
@@ -13,6 +15,8 @@ Layout/LineLength:
1315
Max: 120
1416
Metrics/MethodLength:
1517
Enabled: false
18+
Metrics/PerceivedComplexity:
19+
Enabled: false
1620
Style/StructInheritance:
1721
Enabled: false
1822
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

0 commit comments

Comments
 (0)