This commit is a change of document format for Style/AndOr cop.
This is a similar change to #5156.
Before submitting the PR make sure the following are checked:
Follow up of https://github.com/bbatsov/rubocop/pull/5162#discussion_r154074070.
Example name indicates supported styles. It does not indicate bad and good. They are indicated by source code comments in the example code.
–––––…
I think checkboxes in the PULL_REQUEST_TEMPLATE are too many.
They are a barrier in sending a pull-request.
And attention to other important checkboxes are neglected by noisy checkboxes.
So I think we should reduce the checkboxes.
…
We can omit begin in do-end block since Ruby 2.5.
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/57376
For example, this code is correct in Ruby 2.5.
do_something do
something
rescue => ex
an...
eval can receive a file name and a line number to display actual backtrace.
For example:
eval <<-RUBY
raise rescue p $!.backtrace
RUBY
# => ["(eval):1:in `<main>'", "test.rb:1:in `eval'", "test.rb:1:in `<main>'"]
...
Follow up of #4976.
This commit is a small change of document.
Define the default of style provided by Layout/IndentHash cop in example name.
Before submitting the PR make sure the following are checked:
…
This pull-request will introduce StrNode extension, and refactor heredoc mixin.
First, this pr will add StrNode extension for str, dstr and xstr node types.
It only contains heredoc? method now, and I will use the method in…
Fix for: https://github.com/bbatsov/rubocop/issues/3780
During the autocorrect process for a Rails HTTP positional argument,
this checks whether the original node had parentheses. If there are
parentheses these are included in the f…
On OS X the temp directory is under /var/folder/... but /var is a symlink to /private/var and that causes the symlink check in Cache#save to fail.
This is the same issue than #683 and caused the spec to fail on OS X.
I’m no…
As shown in the test this fixes a case where CharacterLiteral’s auto-correct would break Ruby code when encountering ?', e.g.:
puts ?'
Without the fix in this PR this would be auto-corrected to:
puts '''
...
extend the attr cop implementation to respect the additional boolean param.
Fixes #2483
Iterates through children of nodes without valid source map beginnings and verifies they are string types.
node.loc.begin for nodes of type dstrwill sometimes (always?) return nil.
This causes any string containing a concatenati…
These were things I ran into while I was creating my first cop that I believe will help onboard others.
There's one thing I left blank which is VariableForce. I'm not entirely sure, but I believe this does special things , so instea…
I want this change so that if I need to modify a cop I can use
—show-cop, find the right one, and then copy/paste the body into the
yml and do no extra work to format it for YAML documents.
You'll notice the failing test. I attempte…