Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Aaron Rosenberg
    @agrberg
    It was definitely the metrics ones. I can get you a full list but it'll take a sec.
    Aaron Rosenberg
    @agrberg
    Actually quite a lot more than I thought. I'm not sure why they disappear when it's only the listing of files under the metrics cops that are changing. I'm going to look into a few of them and see if I can't get a better picture of what's happening.
    Benjamin Quorning
    @bquorning
    :+1:
    Aaron Rosenberg
    @agrberg
    I also posted issue #5576 today about the other Rubocop abnormality I was experiencing. I'm not sure if I have something odd with my system since I didn't see any other issues or StackOverflow posts of people with similar problems.
    Aaron Rosenberg
    @agrberg
    I was mistaken, besides a number of Lint/UnneededDisable due to the increased Max the rest were RSpec/MultipleExpectations cops from older tests
    Which is one of the groups that had a list of files replaced by a Max
    Bill Mill
    @llimllib
    I found a bug in rubocop and am attempting to repro with a test in the official repo; what's the best way to run rubocop on itself?
    Mailo Světel
    @roolo
    @llimllib https://github.com/bbatsov/rubocop/blob/master/Rakefile#L48 seems like way to go (rake internal_investigation)
    Steven Zeck
    @stevenzeck
    Hi all. Question, is there a way to get the contents from --auto-correctwhile using --stdin apart from the end of stdout? I'm having trouble splitting the string between the report and the corrections, due to ==================== followed by a newline being different based on the OS and, seemingly, editor settings
    Csaba Apagyi
    @thisismydesign
    hi, i just wrote a post on making parallel auto-correct work, i wonder what you think about it? https://medium.com/@csaba.apagyi/how-to-rubocop-parallel-auto-correct-8d4b68a22d8b
    Pedro Paulino
    @localhostpedro
    Hello everyone

    Rubocop keeps warning me about a decimal number:
    Vagrantfile:36:58: C: Style/NumericLiterals: Use underscores(_) as decimal mark and separate every 3 digits with them.
    config.vm.network :forwarded_port, guest: 27017, host: 27017 # mongodb

    But its actually a port in Vagranfile setup. Is there any way to override this setup not to identify ports as decimal numbers ?

    In order to test, I made something like this:

    config.vm.network :forwarded_port, guest: 270_17, host: 270_17 # mongodb

    And Rubucop identify as a valid setup, returning no offenses detected

    Benjamin Quorning
    @bquorning
    If Vagrantfile is Ruby, then 27017 is a numeric. And in Ruby, 27017 and 27_017 are the same number.
    Pedro Paulino
    @localhostpedro
    @bquorning I made some tests with Vagrant , and it really does forward the port without problems. I ' ll run more tests with MongoDB later on.
    Daniel Vandersluis
    @dvandersluis
    I opened a PR last week that I'd love to get some review on, how can I go about doing that?
    Jonas Arvidsson
    @jonas054
    @thisismydesign I think it's the right approach. It's difficult to combine those options within RuboCop, so a wrapper outside RuboCop is the way to go. You could also do something similar in the shell with rubocop --parallel --format files | xargs rubocop --auto-correct.
    Renato Marinho
    @renatomarinho
    This message was deleted
    Dave Anderson
    @dlanderson
    Is there a way to run a Cop with Autocorrect programmatically within Ruby against a string containing ruby code?
    Mailo Světel
    @roolo
    @dlanderson I think https://github.com/rubocop-hq/rubocop/blob/master/lib/rubocop/runner.rb#L111 Would be good starting point. Of course it'll require some playin' with it
    Dave Anderson
    @dlanderson
    Thanks @roolo I got it working
    Mailo Světel
    @roolo
    @dlanderson Through the do_inspection_loop ?
    Dave Anderson
    @dlanderson
    Would be nice to have an easier, 'official' way to do that.
    Alfonso Perez
    @alfonsoperez
    Hi there!!, I was writing a custom cop and having trouble checking of indexasgn with def_node_matcher
    there seems not to be a callback for that?
    does anybody know how to do this?
    Alfonso Perez
    @alfonsoperez
    ups whitequark/parser@7d72eba
    might then perhaps be my version
    Renato Marinho
    @renatomarinho
    This message was deleted
    Renato Marinho
    @renatomarinho
    This message was deleted
    John Vandenberg
    @jayvdb
    @renatomarinho pls stop spamming every room on gitter
    Evan Brodie
    @ecbrodie

    Hello rubofriends. Is there a way to disable an entire family/group/namespace of cops for a particular set of files?

    For example, in my project, I want to disable all "Metrics" cops for my tests, but keep them enabled for all other code. I could just disable each Metrics cop for the test files as the violations pop up, but I want to see if this functionality already exists or requires a new feature.

    Thanks

    Okay, the correct term was "department", according to the documentation. So, the "Metrics" department.

    Also, I think I just discovered that it is indeed already existing, I was able to just use Metrics:... in my YAML and it worked. Still, not entirely sure if this is the correct approach because I can't find this case mentioned in the docs.

    Simon
    @stoivo

    Hi

    We want to try follow 10 lines per method. I think is is a good rule.
    In most controllers(Rails) we have strong params and with more then 8 agrument is expands over 10 lines.
    I wonder if there is a way to tell rubocop to not check method length for methids with params in it?

    Dominic Sayers
    @dominicsayers
    @ecbrodie So something like this works?
    Metrics:
      Exclude:
        - test/**/*
    Simon
    @stoivo
    anyone?
    Mailo Světel
    @roolo
    @stoivo I don't think it can be based on content of method, but you can disable the rule for that particular method. I would rather split the something_params method or look for another way to slim it
    Simon
    @stoivo

    The think is that we want to write it like

      def file_params
        params
          .require(:file)
          .permit(
            :description, 
            :user_id, 
            :content_type, 
            :created_at, 
            :updated_at, 
            :unit_id, 
            :document_id, 
            :document_type, 
            :sort_id, 
            :is_deleted
          )
      end

    I know I could write it on one line but we want to have it like this.
    In generall we think to 10 lines method like is good. For some controllers we have more then 10 parameters and need more then 10 lines.

    Thomas Volkmar Worm
    @tvw
    What is a reasonable default for Metrics/AbcSize? As soon as a method contains a few conditions, rubocop starts complaining. In order to satisfy rubocop, I had to split a method into two methods, though the code belongs together and makes much more sense in one method.
    Also Metrics/LineLength: I think VT100s are absolutely history. My lines are most of the time below 80, but when using a logger, a line could be longer and splitting the line just to satisfy rubocop makes the code looking very poor.
    Thomas Thomassen
    @thomthom
    Hi all. I'm working on a RuboCop extension - to aid SketchUp developers using our Ruby API. I'm currently reviewing the severity property of the custom departments we are adding. I was wondering if there was some insight to what the various levels available means?
    I've seen the list in the code, and in the docs: https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md#severity
    But I'm curious to when to use what. In particular, is "error" supposed to be used only when RuboCop encounter an internal error processing?
    I've been using error for one department, this one have a set of cops that check for some hard requirement in order to get a SketchUp extension submitted to our Extension Warehouse (basically our app store for extensions to SketchUp)
    But is this severity level misleading?
    Found some older github issues where it seemed to be somewhat unclear exactly what severity should be applied to the different type of reporters: rubocop-hq/rubocop#633
    Steve Whittaker
    @swhitt
    P
    Casper Christensen
    @casperc91_gitlab

    Hi. I have tried to search in the docs and on the web for a Rubocop rule to use <= and < instead of > or >= in comparison, example:

    # bad
    a > 2
    3 >= b
    
    #good
    2 < a
    b <= 3
    4 < c && c <= 7

    Does anyone know if this exist or not? Can't seem to find it.

    andre francois
    @francoisa
    I have installed rubocop 0.62.0 in my rails application, but when I run "bundle exec rake new_cop[dept/name]"
    I get the error : "Don't know how to build task 'new_cop'"
    How do I create a new cop?