Skip to content

Commit 83aa7a8

Browse files
committed
lint
1 parent 60d43df commit 83aa7a8

File tree

7 files changed

+42
-41
lines changed

7 files changed

+42
-41
lines changed

.rubocop.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ inherit_gem:
33
- config/default.yml
44

55
AllCops:
6+
SuggestExtensions: false
67
DisplayCopNames: true
7-
TargetRubyVersion: 2.7.5
8+
TargetRubyVersion: 3.1
89
Exclude:
910
- 'bin/*'
1011
- 'spec/acceptance/fixtures/**/*'

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
entitlements-gitrepo-auditor-plugin (0.2.3)
4+
entitlements-gitrepo-auditor-plugin (0.3.0)
55
contracts (= 0.17)
66
entitlements (= 0.2.0)
77

lib/entitlements/auditor/gitrepo.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def setup
2626
@repo = Entitlements::Util::GitRepo.new(
2727
repo: config["repo"],
2828
sshkey: Base64.decode64(config["sshkey"]),
29-
logger: logger
29+
logger:
3030
)
3131
@repo.github = config["github_override"] if config["github_override"]
3232
@repo.send(operation, checkout_directory)
@@ -59,10 +59,10 @@ def commit(actions:, successful_actions:, provider_exception:)
5959
%w[update_files delete_files].each do |m|
6060
send(
6161
m.to_sym,
62-
action_hash: action_hash,
63-
successful_actions: successful_actions,
64-
sync_changes: sync_changes,
65-
valid_changes: valid_changes
62+
action_hash:,
63+
successful_actions:,
64+
sync_changes:,
65+
valid_changes:
6666
)
6767
end
6868

spec/acceptance/tests/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def run(fixture_dir, args = [])
6363
command_parts = [binary, "--config-file", configfile] + args
6464
command = command_parts.map { |i| Shellwords.escape(i) }.join(" ")
6565
stdout, stderr, exitstatus = Open3.capture3(command)
66-
OpenStruct.new({ stdout: stdout, stderr: stderr, exitstatus: exitstatus.exitstatus, success?: exitstatus.exitstatus == 0 })
66+
OpenStruct.new({ stdout:, stderr:, exitstatus: exitstatus.exitstatus, success?: exitstatus.exitstatus == 0 })
6767
end
6868

6969
def log(priority, pattern)

spec/unit/entitlements/auditor/gitrepo_spec.rb

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@
287287
valid_changes = {}
288288

289289
subject.send(:update_files,
290-
action_hash: action_hash,
291-
successful_actions: successful_actions,
292-
sync_changes: sync_changes,
293-
valid_changes: valid_changes
290+
action_hash:,
291+
successful_actions:,
292+
sync_changes:,
293+
valid_changes:
294294
)
295295

296296
expect(sync_changes).to eq({})
@@ -343,10 +343,10 @@
343343
valid_changes = {}
344344

345345
subject.send(:update_files,
346-
action_hash: action_hash,
347-
successful_actions: successful_actions,
348-
sync_changes: sync_changes,
349-
valid_changes: valid_changes
346+
action_hash:,
347+
successful_actions:,
348+
sync_changes:,
349+
valid_changes:
350350
)
351351

352352
expect(sync_changes).to eq(
@@ -420,10 +420,10 @@
420420
.with("Entitlements::Auditor::GitRepo: Valid change (create dc=net/dc=kittens/ou=Groups/cn=group3) queued")
421421

422422
subject.send(:update_files,
423-
action_hash: action_hash,
424-
successful_actions: successful_actions,
425-
sync_changes: sync_changes,
426-
valid_changes: valid_changes
423+
action_hash:,
424+
successful_actions:,
425+
sync_changes:,
426+
valid_changes:
427427
)
428428

429429
expect(sync_changes).to eq(
@@ -561,10 +561,10 @@
561561
.with("Entitlements::Auditor::GitRepo: Valid change (update dc=net/dc=kittens/ou=Groups/cn=group5) queued")
562562

563563
subject.send(:update_files,
564-
action_hash: action_hash,
565-
successful_actions: successful_actions,
566-
sync_changes: sync_changes,
567-
valid_changes: valid_changes
564+
action_hash:,
565+
successful_actions:,
566+
sync_changes:,
567+
valid_changes:
568568
)
569569

570570
expect(sync_changes).to eq(
@@ -695,10 +695,10 @@
695695
.with("Entitlements::Auditor::GitRepo: Valid change (delete dc=net/dc=kittens/ou=Groups/cn=group5) queued")
696696

697697
subject.send(:update_files,
698-
action_hash: action_hash,
699-
successful_actions: successful_actions,
700-
sync_changes: sync_changes,
701-
valid_changes: valid_changes
698+
action_hash:,
699+
successful_actions:,
700+
sync_changes:,
701+
valid_changes:
702702
)
703703

704704
expect(sync_changes).to eq(
@@ -759,10 +759,10 @@
759759
.with("Entitlements::Auditor::GitRepo: Sync change (delete dc=net/dc=kittens/ou=extra/cn=extragroup) required")
760760

761761
subject.send(:delete_files,
762-
action_hash: action_hash,
763-
successful_actions: successful_actions,
764-
sync_changes: sync_changes,
765-
valid_changes: valid_changes
762+
action_hash:,
763+
successful_actions:,
764+
sync_changes:,
765+
valid_changes:
766766
)
767767

768768
expect(sync_changes).to eq(

spec/unit/entitlements/util/gitrepo_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
let(:directory) { "/tmp/asdlkfjafdiejwroiwejfalskdfjdsklf" }
88
let(:logger) { instance_double(Logger) }
9-
let(:subject) { described_class.new(repo: "kittens/fluffy", sshkey: "xyz123", logger: logger) }
9+
let(:subject) { described_class.new(repo: "kittens/fluffy", sshkey: "xyz123", logger:) }
1010

1111
describe "#add" do
1212
it "executes the command" do

spec/unit/entitlements_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
expect(logger).to receive(:debug).with("Audit Auditor 1 completed successfully")
260260
expect(logger).to receive(:debug).with("Audit Auditor 2 completed successfully")
261261

262-
expect { described_class.execute(actions: actions) }.not_to raise_error
262+
expect { described_class.execute(actions:) }.not_to raise_error
263263
end
264264

265265
it "returns without error with no auditors configured" do
@@ -278,7 +278,7 @@
278278

279279
expect(logger).not_to receive(:debug)
280280

281-
expect { described_class.execute(actions: actions) }.not_to raise_error
281+
expect { described_class.execute(actions:) }.not_to raise_error
282282
end
283283

284284
it "raises when setup of an auditor fails" do
@@ -292,7 +292,7 @@
292292
expect(auditor2).not_to receive(:setup)
293293
expect(auditor2).not_to receive(:commit)
294294

295-
expect { described_class.execute(actions: actions) }.to raise_error(exc)
295+
expect { described_class.execute(actions:) }.to raise_error(exc)
296296
end
297297

298298
it "raises (but runs other auditors) when an auditor fails" do
@@ -332,7 +332,7 @@
332332
allow(logger).to receive(:error)
333333
expect(logger).to receive(:error).with("Audit Auditor 1 failed: RuntimeError Boom")
334334

335-
expect { described_class.execute(actions: actions) }.to raise_error(exc)
335+
expect { described_class.execute(actions:) }.to raise_error(exc)
336336
end
337337

338338
it "raises when a provider fails and there are no auditors" do
@@ -352,7 +352,7 @@
352352

353353
expect(logger).not_to receive(:debug)
354354

355-
expect { described_class.execute(actions: actions) }.to raise_error(exc)
355+
expect { described_class.execute(actions:) }.to raise_error(exc)
356356
end
357357

358358
it "raises (but runs the auditors) when a provider fails" do
@@ -391,7 +391,7 @@
391391
expect(logger).to receive(:debug).with("Audit Auditor 1 completed successfully")
392392
expect(logger).to receive(:debug).with("Audit Auditor 2 completed successfully")
393393

394-
expect { described_class.execute(actions: actions) }.to raise_error(exc)
394+
expect { described_class.execute(actions:) }.to raise_error(exc)
395395
end
396396

397397
it "raises the provider's exception when a provider and auditor both fail" do
@@ -431,7 +431,7 @@
431431
expect(logger).to receive(:debug).with("Audit Auditor 2 completed successfully")
432432
allow(logger).to receive(:error) # Stack trace
433433

434-
expect { described_class.execute(actions: actions) }.to raise_error(exc)
434+
expect { described_class.execute(actions:) }.to raise_error(exc)
435435
end
436436

437437
it "raises and logs a message when multiple auditors fail" do
@@ -472,7 +472,7 @@
472472
expect(logger).to receive(:error).with("Audit Auditor 2 failed: RuntimeError Boom Boom")
473473
allow(logger).to receive(:error) # Stack trace
474474

475-
expect { described_class.execute(actions: actions) }.to raise_error(exc)
475+
expect { described_class.execute(actions:) }.to raise_error(exc)
476476
end
477477
end
478478

0 commit comments

Comments
 (0)