Merge pull request #2934 from fog/style_rules

Add Rubocop and checklist
This commit is contained in:
Paul Thornthwaite 2014-05-26 12:05:22 +01:00
commit 2e4fb619df
3 changed files with 675 additions and 0 deletions

20
.rubocop.yml Normal file
View File

@ -0,0 +1,20 @@
inherit_from: .rubocop_todo.yml
HashSyntax:
EnforcedStyle: hash_rockets
LineLength:
Max: 100
Enabled: false
StringLiterals:
EnforcedStyle: double_quotes
Encoding:
Description: 'Use UTF-8 as the source file encoding.'
Enabled: false
SignalException:
Description: 'Do not enforce use of fail when raising exceptions.'
# Valid values are: semantic, only_raise and only_fail
EnforcedStyle: only_raise

654
.rubocop_todo.yml Normal file
View File

@ -0,0 +1,654 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2014-05-21 12:24:27 -0400 using RuboCop version 0.22.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
AccessModifierIndentation:
Enabled: false
# Offense count: 85
AccessorMethodName:
Enabled: false
# Offense count: 61
# Cop supports --auto-correct.
Alias:
Enabled: false
# Offense count: 139
# Cop supports --auto-correct.
AlignArray:
Enabled: false
# Offense count: 449
# Cop supports --auto-correct.
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles.
AlignHash:
Enabled: false
# Offense count: 104
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
AlignParameters:
Enabled: false
# Offense count: 3
AmbiguousOperator:
Enabled: false
# Offense count: 4
AmbiguousRegexpLiteral:
Enabled: false
# Offense count: 221
# Cop supports --auto-correct.
AndOr:
Enabled: false
# Offense count: 1
ArrayJoin:
Enabled: false
# Offense count: 9
AsciiComments:
Enabled: false
# Offense count: 594
# Configuration parameters: AllowSafeAssignment.
AssignmentInCondition:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
Attr:
Enabled: false
# Offense count: 35
BlockAlignment:
Enabled: false
# Offense count: 56
BlockNesting:
Max: 7
# Offense count: 230
# Cop supports --auto-correct.
Blocks:
Enabled: false
# Offense count: 1366
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
BracesAroundHashParameters:
Enabled: false
# Offense count: 9
CaseEquality:
Enabled: false
# Offense count: 291
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
CaseIndentation:
Enabled: false
# Offense count: 2
# Configuration parameters: EnforcedStyle, SupportedStyles.
ClassAndModuleChildren:
Enabled: false
# Offense count: 100
# Configuration parameters: CountComments.
ClassLength:
Max: 1131
# Offense count: 46
ClassVars:
Enabled: false
# Offense count: 459
# Cop supports --auto-correct.
# Configuration parameters: PreferredMethods.
CollectionMethods:
Enabled: false
# Offense count: 41
# Cop supports --auto-correct.
ColonMethodCall:
Enabled: false
# Offense count: 33
# Configuration parameters: Keywords.
CommentAnnotation:
Enabled: false
# Offense count: 82
# Cop supports --auto-correct.
CommentIndentation:
Enabled: false
# Offense count: 1
ConstantName:
Enabled: false
# Offense count: 451
CyclomaticComplexity:
Max: 46
# Offense count: 29
# Cop supports --auto-correct.
DefWithParentheses:
Enabled: false
# Offense count: 7
# Cop supports --auto-correct.
DeprecatedClassMethods:
Enabled: false
# Offense count: 312
# Cop supports --auto-correct.
DeprecatedHashMethods:
Enabled: false
# Offense count: 6310
Documentation:
Enabled: false
# Offense count: 42
# Configuration parameters: EnforcedStyle, SupportedStyles.
DotPosition:
Enabled: false
# Offense count: 34
DoubleNegation:
Enabled: false
# Offense count: 16
EachWithObject:
Enabled: false
# Offense count: 2
ElseLayout:
Enabled: false
# Offense count: 19
# Cop supports --auto-correct.
# Configuration parameters: AllowAdjacentOneLineDefs.
EmptyLineBetweenDefs:
Enabled: false
# Offense count: 374
# Cop supports --auto-correct.
EmptyLines:
Enabled: false
# Offense count: 63
EmptyLinesAroundAccessModifier:
Enabled: false
# Offense count: 10325
# Cop supports --auto-correct.
EmptyLinesAroundBody:
Enabled: false
# Offense count: 40
# Cop supports --auto-correct.
EmptyLiteral:
Enabled: false
# Offense count: 101
# Configuration parameters: AlignWith, SupportedStyles.
EndAlignment:
Enabled: false
# Offense count: 8
Eval:
Enabled: false
# Offense count: 1
EvenOdd:
Enabled: false
# Offense count: 7
# Configuration parameters: Exclude.
FileName:
Enabled: false
# Offense count: 178
# Configuration parameters: EnforcedStyle, SupportedStyles.
For:
Enabled: false
# Offense count: 16
# Configuration parameters: EnforcedStyle, SupportedStyles.
FormatString:
Enabled: false
# Offense count: 143
# Configuration parameters: MinBodyLength.
GuardClause:
Enabled: false
# Offense count: 27
HandleExceptions:
Enabled: false
# Offense count: 21
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
HashSyntax:
Enabled: false
# Offense count: 481
# Configuration parameters: MaxLineLength.
IfUnlessModifier:
Enabled: false
# Offense count: 54
# Cop supports --auto-correct.
IndentArray:
Enabled: false
# Offense count: 990
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
IndentHash:
Enabled: false
# Offense count: 285
# Cop supports --auto-correct.
IndentationConsistency:
Enabled: false
# Offense count: 310
# Cop supports --auto-correct.
IndentationWidth:
Enabled: false
# Offense count: 7
Lambda:
Enabled: false
# Offense count: 655
# Cop supports --auto-correct.
LeadingCommentSpace:
Enabled: false
# Offense count: 10
# Cop supports --auto-correct.
LineEndConcatenation:
Enabled: false
# Offense count: 6900
LineLength:
Max: 1717
# Offense count: 6
Loop:
Enabled: false
# Offense count: 66
# Cop supports --auto-correct.
MethodCallParentheses:
Enabled: false
# Offense count: 87
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
MethodDefParentheses:
Enabled: false
# Offense count: 2036
# Configuration parameters: CountComments.
MethodLength:
Max: 1129
# Offense count: 13
# Configuration parameters: EnforcedStyle, SupportedStyles.
MethodName:
Enabled: false
# Offense count: 21
MultilineBlockChain:
Enabled: false
# Offense count: 66
MultilineIfThen:
Enabled: false
# Offense count: 13
MultilineTernaryOperator:
Enabled: false
# Offense count: 85
# Cop supports --auto-correct.
NegatedIf:
Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
NegatedWhile:
Enabled: false
# Offense count: 121
# Configuration parameters: EnforcedStyle, SupportedStyles.
Next:
Enabled: false
# Offense count: 28
# Cop supports --auto-correct.
NilComparison:
Enabled: false
# Offense count: 89
# Cop supports --auto-correct.
# Configuration parameters: IncludeSemanticChanges.
NonNilCheck:
Enabled: false
# Offense count: 56
# Cop supports --auto-correct.
Not:
Enabled: false
# Offense count: 220
# Cop supports --auto-correct.
NumericLiterals:
MinDigits: 14
# Offense count: 2
OneLineConditional:
Enabled: false
# Offense count: 33
# Configuration parameters: CountKeywordArgs.
ParameterLists:
Max: 9
# Offense count: 63
# Cop supports --auto-correct.
# Configuration parameters: AllowSafeAssignment.
ParenthesesAroundCondition:
Enabled: false
# Offense count: 17
ParenthesesAsGroupedExpression:
Enabled: false
# Offense count: 189
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
PercentLiteralDelimiters:
Enabled: false
# Offense count: 24
# Cop supports --auto-correct.
PerlBackrefs:
Enabled: false
# Offense count: 8
# Configuration parameters: NamePrefixBlacklist.
PredicateName:
Enabled: false
# Offense count: 7
# Cop supports --auto-correct.
Proc:
Enabled: false
# Offense count: 640
# Configuration parameters: EnforcedStyle, SupportedStyles.
RaiseArgs:
Enabled: false
# Offense count: 25
# Cop supports --auto-correct.
RedundantBegin:
Enabled: false
# Offense count: 4
RedundantException:
Enabled: false
# Offense count: 32
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
RedundantReturn:
Enabled: false
# Offense count: 1939
# Cop supports --auto-correct.
RedundantSelf:
Enabled: false
# Offense count: 66
# Configuration parameters: MaxSlashes.
RegexpLiteral:
Enabled: false
# Offense count: 1
RequireParentheses:
Enabled: false
# Offense count: 5
# Cop supports --auto-correct.
RescueException:
Enabled: false
# Offense count: 52
RescueModifier:
Enabled: false
# Offense count: 29
SelfAssignment:
Enabled: false
# Offense count: 62
# Cop supports --auto-correct.
# Configuration parameters: AllowAsExpressionSeparator.
Semicolon:
Enabled: false
# Offense count: 78
ShadowingOuterLocalVariable:
Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
SignalException:
Enabled: false
# Offense count: 10
# Configuration parameters: Methods.
SingleLineBlockParams:
Enabled: false
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: AllowIfMethodIsEmpty.
SingleLineMethods:
Enabled: false
# Offense count: 909
# Cop supports --auto-correct.
SingleSpaceBeforeFirstArg:
Enabled: false
# Offense count: 4
# Cop supports --auto-correct.
SpaceAfterColon:
Enabled: false
# Offense count: 580
# Cop supports --auto-correct.
SpaceAfterComma:
Enabled: false
# Offense count: 15
# Cop supports --auto-correct.
SpaceAfterControlKeyword:
Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
SpaceAfterMethodName:
Enabled: false
# Offense count: 19
# Cop supports --auto-correct.
SpaceAfterNot:
Enabled: false
# Offense count: 1332
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
SpaceAroundEqualsInParameterDefault:
Enabled: false
# Offense count: 4362
# Cop supports --auto-correct.
SpaceAroundOperators:
Enabled: false
# Offense count: 438
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
SpaceBeforeBlockBraces:
Enabled: false
# Offense count: 11
# Cop supports --auto-correct.
SpaceBeforeComment:
Enabled: false
# Offense count: 17
SpaceBeforeFirstArg:
Enabled: false
# Offense count: 1940
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
SpaceInsideBlockBraces:
Enabled: false
# Offense count: 146
# Cop supports --auto-correct.
SpaceInsideBrackets:
Enabled: false
# Offense count: 6159
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
SpaceInsideHashLiteralBraces:
Enabled: false
# Offense count: 720
# Cop supports --auto-correct.
SpaceInsideParens:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
SpecialGlobalVars:
Enabled: false
# Offense count: 91
# Cop supports --auto-correct.
StringConversionInInterpolation:
Enabled: false
# Offense count: 45586
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
StringLiterals:
Enabled: false
# Offense count: 203
Tab:
Enabled: false
# Offense count: 361
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
TrailingBlankLines:
Enabled: false
# Offense count: 592
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
TrailingComma:
Enabled: false
# Offense count: 836
# Cop supports --auto-correct.
TrailingWhitespace:
Enabled: false
# Offense count: 125
# Cop supports --auto-correct.
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
TrivialAccessors:
Enabled: false
# Offense count: 94
UnderscorePrefixedVariableName:
Enabled: false
# Offense count: 42
UnlessElse:
Enabled: false
# Offense count: 278
# Cop supports --auto-correct.
UnusedBlockArgument:
Enabled: false
# Offense count: 1010
# Cop supports --auto-correct.
UnusedMethodArgument:
Enabled: false
# Offense count: 6
UselessAccessModifier:
Enabled: false
# Offense count: 405
UselessAssignment:
Enabled: false
# Offense count: 3
UselessSetterCall:
Enabled: false
# Offense count: 13
# Cop supports --auto-correct.
VariableInterpolation:
Enabled: false
# Offense count: 29
# Configuration parameters: EnforcedStyle, SupportedStyles.
VariableName:
Enabled: false
# Offense count: 23
Void:
Enabled: false
# Offense count: 6
# Cop supports --auto-correct.
WhileUntilDo:
Enabled: false
# Offense count: 1
# Configuration parameters: MaxLineLength.
WhileUntilModifier:
Enabled: false
# Offense count: 521
# Cop supports --auto-correct.
WordArray:
MinSize: 29

View File

@ -62,6 +62,7 @@ Gem::Specification.new do |s|
s.add_development_dependency('fission')
s.add_development_dependency('pry')
s.add_development_dependency('google-api-client', '~> 0.6', '>= 0.6.2')
s.add_development_dependency('rubocop') if RUBY_VERSION > "1.9"
if ENV["FOG_USE_LIBVIRT"]
s.add_development_dependency('ruby-libvirt','~> 0.5.0')