Skip to content

Commit 8ecf9b0

Browse files
DudeRandom21claude
andcommitted
style: fix rubocop offenses in deploy_spec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9190fac commit 8ecf9b0

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

app/models/shipit/deploy_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def dependencies_steps
8787
Rails.logger.warn(
8888
"Skipping dependency installation: stack uses production_platform " \
8989
"and has no deploy steps requiring local dependencies. " \
90-
"To override, set `dependencies.override` in your shipit.yml.",
90+
"To override, set `dependencies.override` in your shipit.yml."
9191
)
9292
[]
9393
else
@@ -293,12 +293,12 @@ def skip_dependencies_for_production_platform?
293293
# Similarly, discovered task definitions (e.g., kubernetes-restart) are inherently
294294
# safe commands and don't need to be checked here.
295295
all_steps = Array(config('deploy', 'override')) +
296-
Array(config('deploy', 'pre')) +
297-
Array(config('deploy', 'post')) +
298-
Array(config('rollback', 'override')) +
299-
Array(config('rollback', 'pre')) +
300-
Array(config('rollback', 'post')) +
301-
all_task_steps
296+
Array(config('deploy', 'pre')) +
297+
Array(config('deploy', 'post')) +
298+
Array(config('rollback', 'override')) +
299+
Array(config('rollback', 'pre')) +
300+
Array(config('rollback', 'post')) +
301+
all_task_steps
302302

303303
all_steps = all_steps.compact
304304
return false if all_steps.empty?

test/models/deploy_spec_test.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ class DeploySpecTest < ActiveSupport::TestCase
5555
test '#dependencies_steps returns empty when production_platform is configured and all steps are safe' do
5656
@spec.stubs(:load_config).returns(
5757
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
58-
'deploy' => { 'override' => ['production-platform-next deploy my-app production-unrestricted'] },
58+
'deploy' => { 'override' => ['production-platform-next deploy my-app production-unrestricted'] }
5959
)
6060
assert_equal [], @spec.dependencies_steps
6161
end
6262

6363
test '#dependencies_steps still discovers deps when production_platform has unsafe deploy steps' do
6464
@spec.stubs(:load_config).returns(
6565
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
66-
'deploy' => { 'override' => ['bundle exec rake deploy'] },
66+
'deploy' => { 'override' => ['bundle exec rake deploy'] }
6767
)
6868
@spec.expects(:bundler?).returns(true).at_least_once
6969
@spec.expects(:bundle_install).returns(['bundle install'])
@@ -80,7 +80,7 @@ class DeploySpecTest < ActiveSupport::TestCase
8080
test '#dependencies_steps respects explicit override even with production_platform' do
8181
@spec.stubs(:load_config).returns(
8282
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
83-
'dependencies' => { 'override' => ['custom-install'] },
83+
'dependencies' => { 'override' => ['custom-install'] }
8484
)
8585
assert_equal ['custom-install'], @spec.dependencies_steps
8686
end
@@ -89,7 +89,7 @@ class DeploySpecTest < ActiveSupport::TestCase
8989
@spec.stubs(:load_config).returns(
9090
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
9191
'deploy' => { 'override' => ['production-platform-next deploy my-app production-unrestricted'] },
92-
'dependencies' => { 'pre' => ['echo before'], 'post' => ['echo after'] },
92+
'dependencies' => { 'pre' => ['echo before'], 'post' => ['echo after'] }
9393
)
9494
assert_equal ['echo before', 'echo after'], @spec.dependencies_steps
9595
end
@@ -98,8 +98,8 @@ class DeploySpecTest < ActiveSupport::TestCase
9898
@spec.stubs(:load_config).returns(
9999
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
100100
'tasks' => {
101-
'restart' => { 'steps' => ['production-platform-next run-once my-app production-unrestricted restart'] },
102-
},
101+
'restart' => { 'steps' => ['production-platform-next run-once my-app production-unrestricted restart'] }
102+
}
103103
)
104104
assert_equal [], @spec.dependencies_steps
105105
end
@@ -108,8 +108,8 @@ class DeploySpecTest < ActiveSupport::TestCase
108108
@spec.stubs(:load_config).returns(
109109
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
110110
'tasks' => {
111-
'migrate' => { 'steps' => ['bundle exec rake db:migrate'] },
112-
},
111+
'migrate' => { 'steps' => ['bundle exec rake db:migrate'] }
112+
}
113113
)
114114
@spec.expects(:bundler?).returns(true).at_least_once
115115
@spec.expects(:bundle_install).returns(['bundle install'])
@@ -119,15 +119,15 @@ class DeploySpecTest < ActiveSupport::TestCase
119119
test '#dependencies_steps skips deps when production_platform uses kubernetes-deploy' do
120120
@spec.stubs(:load_config).returns(
121121
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
122-
'deploy' => { 'override' => ['kubernetes-deploy --max-watch-seconds 900 my-namespace my-context'] },
122+
'deploy' => { 'override' => ['kubernetes-deploy --max-watch-seconds 900 my-namespace my-context'] }
123123
)
124124
assert_equal [], @spec.dependencies_steps
125125
end
126126

127127
test '#dependencies_steps falls through to discovery when deploy step has unknown command' do
128128
@spec.stubs(:load_config).returns(
129129
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
130-
'deploy' => { 'override' => ['some-unknown-deploy-tool --flag'] },
130+
'deploy' => { 'override' => ['some-unknown-deploy-tool --flag'] }
131131
)
132132
@spec.expects(:discover_dependencies_steps).returns(nil).once
133133
assert_equal [], @spec.dependencies_steps
@@ -137,7 +137,7 @@ class DeploySpecTest < ActiveSupport::TestCase
137137
@spec.stubs(:load_config).returns(
138138
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
139139
'deploy' => { 'override' => ['production-platform-next deploy my-app production-unrestricted'] },
140-
'rollback' => { 'override' => ['bundle exec rake rollback'] },
140+
'rollback' => { 'override' => ['bundle exec rake rollback'] }
141141
)
142142
@spec.expects(:bundler?).returns(true).at_least_once
143143
@spec.expects(:bundle_install).returns(['bundle install'])
@@ -149,8 +149,8 @@ class DeploySpecTest < ActiveSupport::TestCase
149149
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
150150
'deploy' => {
151151
'pre' => ['bundle exec rake before_deploy'],
152-
'override' => ['production-platform-next deploy my-app production-unrestricted'],
153-
},
152+
'override' => ['production-platform-next deploy my-app production-unrestricted']
153+
}
154154
)
155155
@spec.expects(:bundler?).returns(true).at_least_once
156156
@spec.expects(:bundle_install).returns(['bundle install'])
@@ -159,7 +159,7 @@ class DeploySpecTest < ActiveSupport::TestCase
159159

160160
test '#dependencies_steps does not skip when production_platform has no deploy override configured' do
161161
@spec.stubs(:load_config).returns(
162-
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] },
162+
'production_platform' => { 'application' => 'my-app', 'runtime_ids' => ['production-unrestricted'] }
163163
)
164164
@spec.expects(:bundler?).returns(true).at_least_once
165165
@spec.expects(:bundle_install).returns(['bundle install'])

0 commit comments

Comments
 (0)