Skip to content

Commit

Permalink
Layout/InitialIndentation-20240212233131 (#915)
Browse files Browse the repository at this point in the history
* 🚓 regenerate rubocop todo

* 🚓 Layout/InitialIndentation

* 🚓 regenerate rubocop todo

---------

Co-authored-by: Rubocop Challenger <[email protected]>
Co-authored-by: Mathieu Jobin <[email protected]>
  • Loading branch information
3 people authored May 30, 2024
1 parent 5ba0423 commit 26a2807
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 45 deletions.
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,6 @@ Layout/IndentationWidth:
- 'lib/apipie/resource_description.rb'
- 'lib/tasks/apipie.rake'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Layout/InitialIndentation:
Exclude:
- 'spec/dummy/app/controllers/extending_concern.rb'
- 'spec/dummy/app/controllers/sample_controller.rb'

# Offense count: 15
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
Expand Down
14 changes: 7 additions & 7 deletions spec/dummy/app/controllers/extending_concern.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module ExtendingConcern
extend Apipie::DSL::Concern
module ExtendingConcern
extend Apipie::DSL::Concern

update_api(:create) do
param :user, Hash do
param :from_concern, String, :desc => 'param from concern', :allow_nil => false
end
meta metadata: 'data'
update_api(:create) do
param :user, Hash do
param :from_concern, String, :desc => 'param from concern', :allow_nil => false
end
meta metadata: 'data'
end
end
62 changes: 31 additions & 31 deletions spec/dummy/app/controllers/sample_controller.rb
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
module SampleController
extend Apipie::DSL::Concern
module SampleController
extend Apipie::DSL::Concern

api!
def index
render :plain => "OK #{params.inspect}"
end
api!
def index
render :plain => "OK #{params.inspect}"
end

api :GET, '/:resource_id/:id'
param :id, String
def show
render :plain => "OK #{params.inspect}"
end
api :GET, '/:resource_id/:id'
param :id, String
def show
render :plain => "OK #{params.inspect}"
end

def_param_group :concern do
param :concern, Hash, :required => true, :action_aware => true do
param :name, String, "Name of a :concern"
param :concern_type, String
end
def_param_group :concern do
param :concern, Hash, :required => true, :action_aware => true do
param :name, String, "Name of a :concern"
param :concern_type, String
end
end

api :POST, '/:resource_id', "Create a :concern"
param_group :concern
def create
render :plain => "OK #{params.inspect}"
end
api :POST, '/:resource_id', "Create a :concern"
param_group :concern
def create
render :plain => "OK #{params.inspect}"
end

api :PUT, '/:resource_id/:id'
param :id, String
param_group :concern
def update
render :plain => "OK #{params.inspect}"
end
api :PUT, '/:resource_id/:id'
param :id, String
param_group :concern
def update
render :plain => "OK #{params.inspect}"
end

api :GET, '/:resource_id/:custom_subst'
def custom
render :plain => "OK #{params.inspect}"
end
api :GET, '/:resource_id/:custom_subst'
def custom
render :plain => "OK #{params.inspect}"
end
end

0 comments on commit 26a2807

Please sign in to comment.