-
-
Save Serg0/f43099f55ea4bd31dc9e31ced0963e64 to your computer and use it in GitHub Desktop.
Run rubocop with circleci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In spec_helper.rb | |
RSpec.configure do |config| | |
.... | |
rubocop_output = `rubocop` | |
print rubocop_output | |
fail "RuboCop Errors" unless rubocop_output.match(/files inspected, no offenses detected/) | |
end | |
# In .rubocop.yml | |
# Make sure to exclude unused dirs or it'll run 10,000+ files in circleci | |
AllCops: | |
Exclude: | |
- "db/**/*" | |
- "tmp/**/*" | |
- "vendor/**/*" | |
- "bin/**/*" | |
- "log/**/*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment