# 参考: # https://gist.github.com/linyows/ace586b118f87291ed3e AllCops: Exclude: - "小説データ/**/*" - "trash/**/*" - "narou.gemspec" - "spec/**/*" DisplayCopNames: true TargetRubyVersion: 2.5 Metrics/ClassLength: CountComments: false Max: 300 Metrics/ModuleLength: CountComments: false Max: 300 Metrics/AbcSize: Max: 40 Metrics/BlockLength: Max: 40 Metrics/BlockNesting: Max: 3 Metrics/CyclomaticComplexity: Max: 8 Layout/LineLength: Max: 140 AllowURI: true URISchemes: - http - https Style/GuardClause: MinBodyLength: 5 Metrics/MethodLength: Max: 50 Metrics/PerceivedComplexity: Max: 11 Naming/AccessorMethodName: Enabled: true # 条件式の時に使った時のみ警告を出す Style/AndOr: EnforcedStyle: conditionals Style/BlockDelimiters: Enabled: false Style/BracesAroundHashParameters: Enabled: false Style/CollectionMethods: PreferredMethods: detect: "detect" find: "detect" inject: "inject" reduce: "inject" Style/Semicolon: Exclude: - "spec/**/*" Style/AsciiComments: Enabled: false Style/BlockComments: Enabled: false Style/ClassVars: Enabled: false Style/Documentation: Enabled: false Style/DoubleNegation: Enabled: false # 後置 if/unless を使わないほうがわかりやすい場合もある Style/IfUnlessModifier: Enabled: false Style/HashSyntax: Exclude: - "**/*.rake" - "Rakefile" Style/Lambda: Enabled: false Style/RescueModifier: Enabled: false # 1_000_000 と区切り文字が 2 個以上必要になる場合のみ _ 区切りを必須にする Style/NumericLiterals: MinDigits: 7 # has_ から始まるメソッドは許可する Naming/PredicateName: ForbiddenPrefixes: - "is_" - "have_" NamePrefix: - "is_" - "have_" Style/GlobalVars: Enabled: false Layout/FirstHashElementIndentation: Enabled: false Layout/LeadingCommentSpace: Enabled: true Style/LineEndConcatenation: Enabled: true Style/MultilineBlockChain: Enabled: true Style/MultilineTernaryOperator: Enabled: true Style/NegatedIf: Enabled: true Style/Not: Enabled: true Style/PercentLiteralDelimiters: PreferredDelimiters: "%": "!!" "%i": "()" "%q": "!!" "%Q": "!!" "%r": "!!" "%s": "()" "%w": "()" "%W": "()" "%x": "()" Style/PerlBackrefs: Enabled: false Style/RedundantReturn: AllowMultipleReturnValues: true Style/RedundantSelf: Enabled: false Style/SignalException: EnforcedStyle: only_raise Layout/SpaceAfterComma: Enabled: true Layout/SpaceAroundOperators: Enabled: true Layout/SpaceInsideRangeLiteral: Enabled: true Style/SpecialGlobalVars: Enabled: false Style/StringLiterals: EnforcedStyle: double_quotes Style/SymbolProc: Enabled: true Layout/Tab: Enabled: true Layout/TrailingEmptyLines: Enabled: false Style/TrailingCommaInArrayLiteral: Enabled: false Style/TrailingCommaInHashLiteral: Enabled: false Style/TrivialAccessors: Enabled: true Style/UnlessElse: Enabled: true Naming/VariableName: EnforcedStyle: snake_case Style/WordArray: MinSize: 3 Style/StringLiteralsInInterpolation: Enabled: false Style/MutableConstant: Enabled: false Lint/UnderscorePrefixedVariableName: Enabled: false Layout/EmptyLinesAroundClassBody: Enabled: false Style/FrozenStringLiteralComment: Enabled: true Layout/MultilineOperationIndentation: Enabled: false Layout/HeredocIndentation: Enabled: true Style/NumericPredicate: Enabled: false Lint/SuppressedException: Enabled: false Lint/RescueException: Enabled: false Lint/EmptyWhen: Enabled: false Style/FormatStringToken: EnforcedStyle: unannotated Layout/EmptyLineAfterGuardClause: Enabled: false