Hi! I have a question.
I have a
rubocop.yml on Github, which I
inherit_from in all my projects. Some projects are pure Ruby, some Rails, and some use RSpec.
It is fine to
require: rubocop-rails in a Rails project, naturally.
But in a pure Ruby project I would not want to demand that the
rubocop-rails gem is installed (neither should other developers have to install that gem, nor is it needed on CI).
So, how would I organize my shared rubocop config?
I cannot just specify any
Rails/ cop in it, because that raises an error here
Similarly, the RSpec cops should only run in projects that use RSpec.
My idea is to have a
rubocop.ruby.yml and a
rubocop.rails.yml etc. on Github and inherit only the ones I need in my project.
Is that the recommended solution? I thought it was nice to have only one yml file with all cops, but I don't see how I could achieve that without the disadvantages I tried to describe.
Thank you very much.
curious why ruby-parse considers a block that has multiple lines to be nested within a begin. I know this isn't a rubocop question, just trying to figure out how one would generically say:
this method call within a block of this type
is it easier to do that or
this block with this method call within
create_table :a_table do |z| z.goober :name z.string :col end create_table :a_table do |z| z.goober :name end
(begin (block (send nil :create_table (sym :a_table)) (args (procarg0 (arg :z))) (begin (send (lvar :z) :goober (sym :name)) (send (lvar :z) :string (sym :col)))) (block (send nil :create_table (sym :a_table)) (args (procarg0 (arg :z))) (send (lvar :z) :goober (sym :name))))
@myii:matrix.org Hi, loving
rubocop, we've deployed it across over 60 of our repos under https://github.com/saltstack-formulas. Found an issue with
rubocop -a --safe, the first time it's actually caused a breakage. This is the section, before and after:
test/integration/default/controls/config_spec.rb:158:35: F: Lint/Syntax: unterminated string meets end of file
Worth a bug report?
Hi, I believe I found a bug that has possibly been fixed in a newer version of Rubocop. In version
0.57.2, this code:
time_period = updated_during ? updated_during : 2.days.ago..Time.now
is autocorrected to
time_period = updated_during || 2.days.ago..Time.now
However, that’s incorrect if
updated_during is not
|| has a higher precedence than
? has a lower precedence than
Hello friends! Is there any research or ongoing mechanism to allow us to use RuboCop combining
autocorrect with user input confirmation?
I'm asking because today a friend shared a script (https://gist.github.com/jaimerson/57847f25191f58018af06c1c1ea0e4f6) that autocorrects subject names from
RSpec/NamedSubject and gives the opportunity to fix it ongoing or accept the suggestions. While cleaning up offenses it would speed up a lot the flow and we could have a default and allow people to edit it if they want through the interactive mode.
It would also allow us to interactive fix cops that doesn't have autocorrect implementation because of some the dependency of the user input.
Trying to find the Rubocop yml file. I looked in the .gem and .rvm folders.
May not quite be the right place for it but does unlock a lot of interesting potential for really succinct corrections
PATTERNcan't parse the second call to git, that is,
How can I reproduce your issue exactly?
Or you can just run:
rubocop-packaging with rubocop v0.86 and v0.87.
With v0.86, the tests pass. With v0.87, the tests fail :disappointed:
Two quick questions:
Is 0.89 going to be released soon? My hands are itching to merge the PR (in
rubocop-rspec) fixing offences raised by newly introduced cops.
WDYT of bumping the version in
version.rb to the next patch version? We have an
edge-rubocop CI job, and it fetches RuboCop from
master. It's somewhat confusing to see
Using rubocop 0.88.0 from https://github.com/rubocop-hq/rubocop.git (at master@ca9483a) and failures from cops that didn't exist in 0.88.0.
rubocop-railsmay be used with different versions of
rubocop, can they have different cop lists in such cases? E.g.: In the first case I have
rubocop-rspecversion 1.42.0 and
rubocopversion 0.87; in the second case I have
rubocop-rspecversion 1.42.0 and
rubocopversion 0.89. Will I get the same cops in both cases?