loopstudio/rails-api-boilerplate

CircleCI not checking rubocop rules

Closed this issue · 6 comments

I ran rubocop in my machine (I'm in master), and there are a lot of errors. CircleCI should check this.

@mwolman I'm not sure about what do u mean by

there are lot of errors

coud you provide a sreenshot or something ?. In any case the rake task that takes care of running rubocop is being executed on CI. Take a look. I imagine that you run rubocop over the hole app instead of running in it over app - lib - db - config -spec

Screen Shot 2019-10-04 at 7 20 25 PM

@mwolman I'm not sure about what do u mean by

there are lot of errors

coud you provide a sreenshot or something ?. In any case the rake task that takes care of running rubocop is being executed on CI. Take a look. I imagine that you run rubocop over the hole app instead of running in it over app - lib - db - config -spec

Screen Shot 2019-10-04 at 7 20 25 PM

In this moment you're not going to see any errors, because I fixed them. But there were errors in master, and the CI didn't notify about that.

I see. I guess you are talking about this commit of yours, right ? I don't think that represent a lot of errors, but anyways perhaps the explanation could be in the direction of different rubocop versions on your local machine and the CI server. In any case, I see rubocop running on the CI server, so unless you can reproduce the issue like forcing an styling error and seeing if the CI pass, we will be closing this issue. Makes sense ? @mwolman

Mica ran rubocop con the whole app (not just the folders set in the code analyzer task) and fixed the issues. (Thank you for that)

What this issue is saying is that we now need to verify that circleCi is actually failing if there are warnings of the linterns.
We need to create a PR that we know that makes the linterns fail in the folders configured in the code_analyzer task. If everything is correct then the circleCI checks should fail.

haha I was right, @mwolman at that moment you run rubocop over the whole app and by that moment the folders spec and db where not included in the analysis of rubocop. The styling errors that you solved where origin from one of those folders. After your commit, @letiesperon included those folders, whit this commit.

haha I was right, @mwolman at that moment you run rubocop over the whole app and by that moment the folders spec and db where not included in the analysis of rubocop. The styling errors that you solved where origin from one of those folders. After your commit, @letiesperon included those folders, whit this commit.

Good, thanks for finding the issue!

@letiesperon what do you think about removing the specification of each folder and running it in the whole app? In another project I have this configuration:

AllCops:
  RubyInterpreters:
    - ruby
    - macruby
    - rake
    - jruby
    - rbx
  # Include common Ruby source files.
  Include:
    - '**/*.rb'
    - '**/*.arb'
    - '**/*.axlsx'
    - '**/*.builder'
    - '**/*.fcgi'
    - '**/*.gemfile'
    - '**/*.gemspec'
    - '**/*.god'
    - '**/*.jb'
    - '**/*.jbuilder'
    - '**/*.mspec'
    - '**/*.opal'
    - '**/*.pluginspec'
    - '**/*.podspec'
    - '**/*.rabl'
    - '**/*.rake'
    - '**/*.rbuild'
    - '**/*.rbw'
    - '**/*.rbx'
    - '**/*.ru'
    - '**/*.ruby'
    - '**/*.spec'
    - '**/*.thor'
    - '**/*.watchr'
    - '**/.irbrc'
    - '**/.pryrc'
    - '**/buildfile'
    - '**/Appraisals'
    - '**/Berksfile'
    - '**/Brewfile'
    - '**/Buildfile'
    - '**/Capfile'
    - '**/Cheffile'
    - '**/Dangerfile'
    - '**/Deliverfile'
    - '**/Fastfile'
    - '**/*Fastfile'
    - '**/Gemfile'
    - '**/Guardfile'
    - '**/Jarfile'
    - '**/Mavenfile'
    - '**/Podfile'
    - '**/Puppetfile'
    - '**/Rakefile'
    - '**/Snapfile'
    - '**/Thorfile'
    - '**/Vagabondfile'
    - '**/Vagrantfile'
  Exclude:
    - 'db/**/*'
    - 'node_modules/**/*'
    - 'vendor/**/*'
    - '.git/**/*'

and it works perfectly when we ran rubocop in the whole app.