rubocop
https://github.com/bbatsov/rubocop
Ruby
A Ruby static code analyzer, based on the community Ruby style guide.
RuboCop::Cop::Rails::HttpPositionalArguments#autocorrect
given a pre Rails 5 method: get :new, user_id: @user.id, {}
the result should look like:
get :new, params: { user_id: @user.id }, headers: {}
the http_method is the method use to call the controller
the controller node can be a symbol, method, object or string
that represents the path/action on the Rails controller
the data is the http parameters and environment sent in
the Rails 5 http callEdit
git clone [email protected]:bbatsov/rubocop.git
cd rubocop
open lib/rubocop/cop/rails/http_positional_arguments.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-RuboCop--Cop--Rails--HttpPositionalArguments-autocorrect-for-pr
# Commit to gitgit add lib/rubocop/cop/rails/http_positional_arguments.rbgit commit -m "better docs for RuboCop::Cop::Rails::HttpPositionalArguments#autocorrect"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-RuboCop--Cop--Rails--HttpPositionalArguments-autocorrect-for-pr
hub pull-request
# Celebrate!