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

New rubocop syntax #254

Merged
merged 4 commits into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rubocop-results.xml
/reports
/docker/deployment/user_variables.json
*.log
.rubocop-https*

# in some configs the server and worker data are persisted in this directory, never commit
server-data
Expand Down
110 changes: 3 additions & 107 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,110 +4,6 @@ AllCops:
- 'server/lib/delayed/heartbeat/**/*'
- 'server/vendor/bundle/**/*'

Rails:
Enabled: true

# ==================== Linters ====================
Lint/AmbiguousOperator:
Enabled: true

Lint/BlockAlignment:
Enabled: true

Lint/ParenthesesAsGroupedExpression:
Enabled: true

Lint/RequireParentheses:
Enabled: true

Lint/UnreachableCode:
Enabled: false

Lint/UselessAssignment:
Enabled: true

# ==================== Styles ====================
Metrics/BlockNesting:
Max: 4

# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 500

Metrics/CyclomaticComplexity:
Max: 48

Metrics/LineLength:
Max: 1200

# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 350

# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 8

# ==================== Disabled on Purpose ====================
# Mongoid doesn't like find_each.
Rails/FindEach:
Enabled: false

Style/AccessorMethodName:
Enabled: true

# Need to allow indented case statements
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
Style/CaseIndentation:
Enabled: false

# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassAndModuleChildren:
Enabled: false

Style/ClassVars:
Enabled: false

Style/Documentation:
Enabled: false

Style/EachWithObject:
Enabled: false

# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Enabled: false

# Configuration parameters: MinBodyLength.
Style/GuardClause:
Enabled: true

# Configuration parameters: MaxLineLength.
Style/IfUnlessModifier:
Enabled: false

# Do NOT enable. For some reason this is catching any next which I feel are okay.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/Next:
Enabled: false

# Do NOT enable this because it appears $? is different than $CHILD_STATUS.
# Cop supports --auto-correct.
Style/SpecialGlobalVars:
Enabled: false

# a = if true
# 1
# else
# 2
# end
Style/ConditionalAssignment:
Enabled: false

Style/MultilineMethodCallIndentation:
EnforcedStyle: aligned
Enabled: true

# 27000 => 27_000
Style/NumericLiterals:
Enabled: false
inherit_from:
- https://raw.githubusercontent.com/NREL/OpenStudio-resources/add-styles-linters/styles/rubocop.yml
- https://raw.githubusercontent.com/NREL/OpenStudio-resources/add-styles-linters/styles/rubocop-rails.yml