Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rubocop to rake default set #1392

Merged
merged 4 commits into from
Feb 18, 2017
Merged

Add rubocop to rake default set #1392

merged 4 commits into from
Feb 18, 2017

Conversation

jasonrclark
Copy link
Member

Enough folks (including me) trip over this on first pushes, worth putting in the default testing set.

Enough folks (including me) trip over this on first pushes, worth
putting in the default testing set
@PragTob
Copy link
Member

PragTob commented Feb 13, 2017

if we do this, shouldn't we maybe make the rake do whatever our whole travis build script does? E.g. also spec:all etc?

otherwise, good ;)

@jasonrclark
Copy link
Member Author

So default rake actually ends up running spec which runs spec:all... so maybe I should just change Travis to run rake as part of this too. What do you think?

This encourages us to keep the things we test on CI the same as the
things people will probably run by default in the project.
@jasonrclark
Copy link
Member Author

On further consideration, made a few more tweaks:

  • Added option to keep the cop name reporting in Rubocop, which I find useful
  • Did indeed update .travis.yml to just run bundle exec rake. Keeps us honest on what our defaults are vs what CI runs
  • Recommended for testing that people just run rake instead of rake spec so they'll get the full effect of what they're asked to pass in CI

Copy link
Member

@PragTob PragTob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some small comments + I noticed that rubocop seems to be executed last now... I think it's good to run linters first to bail and fail the build early.

README.md Outdated
@@ -200,7 +200,7 @@ Shoes 4 is developed in a TDD style using RSpec. You should be writing and runni

The simplest way to do this is with rake tasks.

$ rake spec
$ rake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bundle exec! (otherwise packaging specs fail for me)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still fails? I thought I'd fixed that.

Either way, I'll update this as my rule is ABB... "Always Be Bundling"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, maybe you fixed it and I just haven't knowingly tried afterwards ever again :)

@@ -1,7 +1,6 @@
language: ruby
script:
- bundle exec rubocop -D
- bundle exec rake spec:all
- bundle exec rake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think travis runs rake as default but probably without bundle exec or maybe, not sure - also it's better to be explicit. So this is good. I don't know what I'm writing ;P

task.options << "--display-cop-names"
end

task default: :rubocop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jasonrclark jasonrclark merged commit 67458a7 into master Feb 18, 2017
@jasonrclark jasonrclark deleted the rubocop-in-rake-default branch February 18, 2017 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants