1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add codeclimate and rubocop config files

We're going to be experimenting with a new bot for them. This will not
cause anything to start affecting new PRs yet, but it will have data
sent to them so they can do "dry run" stuff on their end.

The rubocop file is based on our documented style guide. I've only
included rules which are either already consistently applied throughout
the entire codebase, or where added lines should be following the
guideline regardless of the surrounding code (such as hash syntax)
This commit is contained in:
Sean Griffin 2016-06-13 10:29:50 -04:00
parent 01fc08f694
commit 7d883b8293
2 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,27 @@
engines:
rubocop:
enabled: true
ratings:
paths:
- "**.rb"
exclude_paths:
- actioncable/lib/rails/generators/
- actioncable/test/
- actionmailer/lib/rails/generators/
- actionmailer/test/
- actionpack/test/
- actionview/test/
- activejob/lib/rails/generators/
- activejob/test/
- activemodel/test/
- activerecord/lib/rails/generators/
- activerecord/test/
- activesupport/test/
- railties/lib/rails/generators/
- railties/test/
- ci/
- guides/
- tasks/
- tools/

27
activerecord/.rubocop.yml Normal file
View file

@ -0,0 +1,27 @@
AllCops:
TargetRubyVersion: 2.3
DisabledByDefault: true
# Two spaces, no tabs (for indentation).
Style/IndentationWidth:
enabled: true
# No trailing whitespace.
Style/TrailingWhitespace:
enabled: true
# Blank lines should not have any spaces.
Style/TrailingBlankLines:
enabled: true
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Style/HashSyntax:
enabled: true
# Prefer &&/|| over and/or.
Style/AndOr:
enabled: true
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
Lint/RequireParentheses:
enabled: true