24 Pull Requests
bbatsov

rubocop/rubocop

A Ruby static code analyzer and formatter, based on the community Ruby style guide.
Ruby
View on GitHub https://docs.rubocop.org
bug
feature
documentation
tests
help-wanted
refactoring
enhancement
beginner
good first issue
Contribulator score: 44 Last scored 2023-11-08 06:31:01 UTC
Contributors (12)
  • bfontaine
  • blainesch
  • eitoball
  • katieschilling
  • kevindew
  • koic
  • krainboltgreene
  • oliverklee
  • pocke
  • seanhussey
  • weh
  • yhirano55

Pull requests (46)

koic

Add new `Rails/UnneededReceiverInWithOptions` cop to bbatsov/rubocop 2017-12-05 10:31:35 UTC

Feature

This cop checks for unneeded receiver in with_options.
Receiver is implicit from Rails 4.2 or higher.

Bad case

class Account < ApplicationRecord
  with_options dependent: :destroy do |assoc|
    asso...
koic

Restyle example formatting for `Style/AndOr` cop to bbatsov/rubocop 2017-12-02 16:57:32 UTC

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:

  • Wrote [good commit messages][1].
  • [ …
koic

Restyle example formatting for `Layout/ClassStructure` cop to bbatsov/rubocop 2017-12-02 16:57:18 UTC

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.

–––––…

pocke

Reduce checkboxes from the PULL_REQUEST_TEMPLATE to bbatsov/rubocop 2017-12-02 11:17:59 UTC

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.

…

pocke

Make Style/RedundantBegin aware of do-end block in Ruby 2.5 to bbatsov/rubocop 2017-12-02 10:50:36 UTC

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...
pocke

Make new_cop task to modify `config/enabled.yml` to bbatsov/rubocop 2017-12-02 10:22:43 UTC

Problem

Currently, new_cop task does not modify config/enabled.yml(or config/disabled.yml).
It is not good. We should edit config/enabled.yml manually when we add a new cop.

Solution

Make new_cop task to modify `confi…

pocke

Add a new `Style/EvalWithLocation` cop to bbatsov/rubocop 2017-12-02 07:34:58 UTC

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>'"]
...
koic

Update an example to `Layout/IndentHash` to bbatsov/rubocop 2017-12-01 16:54:58 UTC

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:
…

pocke

Introduce StrNode extension to bbatsov/rubocop 2017-12-01 13:21:35 UTC

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…

kevindew

[Fix #3780] Maintain parentheses in auto-correcting Rails HTTP positional arguments to bbatsov/rubocop 2016-12-11 16:01:59 UTC

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…

bfontaine

Ensure ResultCache.cache_root doesn't return symlinks to bbatsov/rubocop 2015-12-21 11:37:43 UTC

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…

bfontaine

Fix CharacterLiteral's auto-correct of single quotes to bbatsov/rubocop 2015-12-21 00:20:53 UTC

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 '''
...
seanhussey

Fixing an itty-bitty typo. to bbatsov/rubocop 2015-12-15 20:32:31 UTC

weh

fix attr cop implementation bbatsov/rubocop#2483 to bbatsov/rubocop 2015-12-12 23:08:45 UTC

extend the attr cop implementation to respect the additional boolean param.
Fixes #2483

oliverklee

[TASK] Configure Travis for better build performance to bbatsov/rubocop 2014-12-22 16:14:18 UTC

  • set sudo: false to allow usage of their new container-based infrastructure
  • enable bundler caching
blainesch

Add auto-correct for the `EvenOdd` cop to the chnagelog. to bbatsov/rubocop 2014-12-20 15:58:57 UTC

Fixes comment in #1506

blainesch

Add autocorrection for even? and odd? style cop. to bbatsov/rubocop 2014-12-17 14:28:13 UTC

katieschilling

[Fix #1474] LineEndConcatenation cop catches multiline string with '<<' and '\' to bbatsov/rubocop 2014-12-07 22:18:33 UTC

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…

blainesch

Add instructions on how to add a new cop. to bbatsov/rubocop 2014-12-05 00:13:24 UTC

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…

blainesch

Add ExtraSpacing cop that detects unnecessary whitespace. to bbatsov/rubocop 2014-12-04 06:39:13 UTC

Fixes #1434 and #1450

krainboltgreene

We want to make the output match the yml expectations to bbatsov/rubocop 2013-12-18 04:56:48 UTC

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…

« First ‹ Prev 1 2
  • Sponsored by  DNSimple,  Octobox &  Bugsnag
  • About
  • How to contribute?
  • API
  • Unsubscribe
    •  English
    •  Español
    •  Ελληνικά
    •  Português do Brasil
    •  Suomi
    •  Français
    •  Deutsch
    •  Русский
    •  Українська
    •  ไทย
    •  Italiano
    •  Norsk bokmål
    •  தமிழ்
    •  Tr
    •  简体中文
    •  正體中文
    •  日本語
    •  Čeština
    •  हिंदी
    •  Polski
    • Translate into your language!