Skip to content

Commit

Permalink
Possibly fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Jan 6, 2025
1 parent f7ae9e2 commit 3728d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions gems/smithy/lib/smithy/polishes/rubocop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ module Smithy
module Polishes
# Runs RuboCop on the generated projections.
class RuboCop < Polish
# TODO: maybe this can be a rubocop config file that is copied in to the gem?
EXCLUDED_COPS = [
'Gemspec/RequiredRubyVersion', # broken because of approach for running rubocop here
'Style/Documentation', # We should add these but should ignore spec files
# Module name may have dashes based upon the gem name
'Naming/FileName',
# Generated code can be long or complex
'Layout/LineLength',
'Metrics/AbcSize',
'Metrics/BlockLength',
'Metrics/MethodLength',
'Metrics/ModuleLength',
# TODO: fix this? map member in struct will override the map method.
'Lint/StructNewOverride'
].freeze
Expand All @@ -22,12 +26,10 @@ def polish(_artifact)
rubocop = ::RuboCop::CLI.new
args = [
'--autocorrect-all',
'--fail-level',
'info',
'--except',
EXCLUDED_COPS.join(','),
'--display-only-fail-level-offenses',
"#{destination_root}/lib/**/*.rb"
destination_root
]
status = rubocop.run(args)
raise 'RuboCop failed' unless status.zero?
Expand Down
10 changes: 5 additions & 5 deletions projections/weather/spec/weather/endpoint_provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ module Weather
describe EndpointProvider do
subject { EndpointProvider.new }

context "Endpoint set" do
context 'Endpoint set' do
let(:expected) do
{"endpoint"=>{"url"=>"https://example.com"}}
{ 'endpoint' => { 'url' => 'https://example.com' } }
end

it 'produces the expected output from the EndpointProvider' do
params = EndpointParameters.new(**{:endpoint=>"https://example.com"})
params = EndpointParameters.new(endpoint: 'https://example.com')
endpoint = subject.resolve_endpoint(params)
expect(endpoint.uri).to eq(expected['endpoint']['url'])
expect(endpoint.headers).to eq(expected['endpoint']['headers'] || {})
expect(endpoint.properties).to eq(expected['endpoint']['properties'] || {})
end
end

context "Endpoint not set" do
context 'Endpoint not set' do
let(:expected) do
{"error"=>"Endpoint is not set - you must configure an endpoint."}
{ 'error' => 'Endpoint is not set - you must configure an endpoint.' }
end

it 'produces the expected output from the EndpointProvider' do
Expand Down

0 comments on commit 3728d95

Please sign in to comment.