Skip to content

Commit 8a7fc62

Browse files
committed
(CONT-773) Rubocop Unsafe Auto Fixes 4-5
- Style/GlobalStdStream - Style/SlicingWithRange
1 parent 3d5e236 commit 8a7fc62

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,7 @@ Security/Open:
128128
Exclude:
129129
- 'lib/puppet/provider/apt_key/apt_key.rb'
130130

131-
# Offense count: 1
132-
# This cop supports unsafe autocorrection (--autocorrect-all).
133-
Style/GlobalStdStream:
134-
Exclude:
135-
- 'tasks/init.rb'
136-
137131
# Offense count: 1
138132
Style/MixinUsage:
139133
Exclude:
140134
- 'spec/spec_helper.rb'
141-
142-
# Offense count: 2
143-
# This cop supports unsafe autocorrection (--autocorrect-all).
144-
Style/SlicingWithRange:
145-
Exclude:
146-
- 'lib/puppet/provider/apt_key/apt_key.rb'

lib/puppet/provider/apt_key/apt_key.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def self.key_line_hash(pub_line, fpr_line)
9292
fingerprint = fpr_split.last
9393
return_hash = {
9494
key_fingerprint: fingerprint,
95-
key_long: fingerprint[-16..-1], # last 16 characters of fingerprint
96-
key_short: fingerprint[-8..-1], # last 8 characters of fingerprint
95+
key_long: fingerprint[-16..], # last 16 characters of fingerprint
96+
key_short: fingerprint[-8..], # last 8 characters of fingerprint
9797
key_size: pub_split[2],
9898
key_type: nil,
9999
key_created: Time.at(pub_split[5].to_i),

tasks/init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def apt_get(action)
2121
{ status: stdout.strip }
2222
end
2323

24-
params = JSON.parse(STDIN.read)
24+
params = JSON.parse($stdin.read)
2525
action = params['action']
2626

2727
begin

0 commit comments

Comments
 (0)