Revision b697e513
Added by Michael Moll almost 6 years ago
.rubocop.yml | ||
---|---|---|
AllCops:
|
||
TargetRubyVersion: 2.3
|
||
TargetRailsVersion: 5.1
|
||
Include:
|
||
- 'app/views/api/**/*.rabl'
|
||
Exclude:
|
||
- 'db/schema.rb'
|
||
- 'node_modules/**/*'
|
.rubocop_todo.yml | ||
---|---|---|
# This configuration was generated by
|
||
# `rubocop --auto-gen-config --exclude-limit 0`
|
||
# on 2018-04-01 14:49:00 +0200 using RuboCop version 0.54.0.
|
||
# on 2018-06-09 16:44:26 +0200 using RuboCop version 0.54.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: 624
|
||
# Offense count: 635
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
||
# SupportedHashRocketStyles: key, separator, table
|
||
... | ... | |
Layout/AlignHash:
|
||
Enabled: false
|
||
|
||
# Offense count: 609
|
||
# Offense count: 622
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
||
# SupportedStyles: with_first_parameter, with_fixed_indentation
|
||
... | ... | |
Layout/CaseIndentation:
|
||
Enabled: false
|
||
|
||
# Offense count: 29
|
||
# Offense count: 34
|
||
# Cop supports --auto-correct.
|
||
Layout/ClosingParenthesisIndentation:
|
||
Enabled: false
|
||
|
||
# Offense count: 44
|
||
# Offense count: 55
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
|
||
Layout/ExtraSpacing:
|
||
Enabled: false
|
||
|
||
# Offense count: 31
|
||
# Offense count: 30
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
|
||
Layout/IndentHeredoc:
|
||
Enabled: false
|
||
|
||
# Offense count: 173
|
||
# Offense count: 177
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: symmetrical, new_line, same_line
|
||
Layout/MultilineHashBraceLayout:
|
||
Enabled: false
|
||
|
||
# Offense count: 68
|
||
# Offense count: 72
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: symmetrical, new_line, same_line
|
||
Layout/MultilineMethodCallBraceLayout:
|
||
Enabled: false
|
||
|
||
# Offense count: 83
|
||
# Offense count: 89
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
||
# SupportedStyles: aligned, indented, indented_relative_to_receiver
|
||
Layout/MultilineMethodCallIndentation:
|
||
Enabled: false
|
||
|
||
# Offense count: 68
|
||
# Offense count: 71
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
||
# SupportedStyles: aligned, indented
|
||
Layout/MultilineOperationIndentation:
|
||
Enabled: false
|
||
|
||
# Offense count: 902
|
||
# Offense count: 941
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: AllowForAlignment.
|
||
Layout/SpaceAroundOperators:
|
||
Enabled: false
|
||
|
||
# Offense count: 94
|
||
# Offense count: 95
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: space, no_space
|
||
... | ... | |
Layout/SpaceBeforeBlockBraces:
|
||
Enabled: false
|
||
|
||
# Offense count: 341
|
||
# Offense count: 350
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
|
||
# SupportedStyles: space, no_space, compact
|
||
... | ... | |
Layout/SpaceInsideArrayLiteralBrackets:
|
||
Enabled: false
|
||
|
||
# Offense count: 520
|
||
# Offense count: 529
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
||
# SupportedStyles: space, no_space
|
||
... | ... | |
Layout/SpaceInsideBlockBraces:
|
||
Enabled: false
|
||
|
||
# Offense count: 3412
|
||
# Offense count: 3507
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
||
# SupportedStyles: space, no_space, compact
|
||
... | ... | |
Layout/SpaceInsideHashLiteralBraces:
|
||
Enabled: false
|
||
|
||
# Offense count: 39
|
||
# Offense count: 43
|
||
Lint/AmbiguousBlockAssociation:
|
||
Enabled: false
|
||
|
||
# Offense count: 121
|
||
# Offense count: 122
|
||
Lint/AmbiguousRegexpLiteral:
|
||
Enabled: false
|
||
|
||
... | ... | |
Lint/DuplicateMethods:
|
||
Enabled: false
|
||
|
||
# Offense count: 13
|
||
# Offense count: 14
|
||
Lint/HandleExceptions:
|
||
Enabled: false
|
||
|
||
... | ... | |
Lint/NonLocalExitFromIterator:
|
||
Enabled: false
|
||
|
||
# Offense count: 21
|
||
# Offense count: 23
|
||
Lint/ParenthesesAsGroupedExpression:
|
||
Enabled: false
|
||
|
||
... | ... | |
Lint/ShadowingOuterLocalVariable:
|
||
Enabled: false
|
||
|
||
# Offense count: 96
|
||
# Offense count: 102
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
|
||
Lint/UnusedBlockArgument:
|
||
Enabled: false
|
||
|
||
# Offense count: 112
|
||
# Offense count: 113
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
|
||
Lint/UnusedMethodArgument:
|
||
... | ... | |
Lint/Void:
|
||
Enabled: false
|
||
|
||
# Offense count: 602
|
||
# Offense count: 604
|
||
Metrics/AbcSize:
|
||
Max: 128
|
||
|
||
# Offense count: 317
|
||
# Offense count: 345
|
||
# Configuration parameters: CountComments, ExcludedMethods.
|
||
Metrics/BlockLength:
|
||
Max: 1336
|
||
Max: 1342
|
||
|
||
# Offense count: 12
|
||
# Offense count: 14
|
||
# Configuration parameters: CountBlocks.
|
||
Metrics/BlockNesting:
|
||
Max: 6
|
||
... | ... | |
# Offense count: 59
|
||
# Configuration parameters: CountComments.
|
||
Metrics/ClassLength:
|
||
Max: 755
|
||
Max: 746
|
||
|
||
# Offense count: 153
|
||
# Offense count: 150
|
||
Metrics/CyclomaticComplexity:
|
||
Max: 24
|
||
|
||
# Offense count: 11026
|
||
# Offense count: 11621
|
||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||
# URISchemes: http, https
|
||
Metrics/LineLength:
|
||
Max: 385
|
||
|
||
# Offense count: 508
|
||
# Offense count: 522
|
||
# Configuration parameters: CountComments.
|
||
Metrics/MethodLength:
|
||
Max: 176
|
||
... | ... | |
Metrics/ParameterLists:
|
||
Max: 7
|
||
|
||
# Offense count: 126
|
||
# Offense count: 125
|
||
Metrics/PerceivedComplexity:
|
||
Max: 25
|
||
|
||
# Offense count: 40
|
||
# Offense count: 42
|
||
Naming/AccessorMethodName:
|
||
Enabled: false
|
||
|
||
... | ... | |
Naming/BinaryOperatorParameterName:
|
||
Enabled: false
|
||
|
||
# Offense count: 22
|
||
# Offense count: 20
|
||
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
||
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
||
Naming/FileName:
|
||
Enabled: false
|
||
|
||
# Offense count: 24
|
||
# Offense count: 29
|
||
# Configuration parameters: Blacklist.
|
||
# Blacklist: END, (?-mix:EO[A-Z]{1})
|
||
Naming/HeredocDelimiterNaming:
|
||
Enabled: false
|
||
|
||
# Offense count: 20
|
||
# Offense count: 21
|
||
Naming/MemoizedInstanceVariableName:
|
||
Enabled: false
|
||
|
||
... | ... | |
Naming/PredicateName:
|
||
Enabled: false
|
||
|
||
# Offense count: 145
|
||
# Offense count: 150
|
||
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
||
# AllowedNames: io, id, to
|
||
Naming/UncommunicativeMethodParamName:
|
||
Enabled: false
|
||
|
||
# Offense count: 40
|
||
# Offense count: 46
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: snake_case, normalcase, non_integer
|
||
Naming/VariableNumber:
|
||
... | ... | |
Rails/Date:
|
||
Enabled: false
|
||
|
||
# Offense count: 458
|
||
# Offense count: 494
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: Whitelist.
|
||
# Whitelist: find_by_sql
|
||
Rails/DynamicFindBy:
|
||
Enabled: false
|
||
|
||
# Offense count: 24
|
||
# Offense count: 25
|
||
Rails/FilePath:
|
||
Enabled: false
|
||
|
||
... | ... | |
Rails/HasAndBelongsToMany:
|
||
Enabled: false
|
||
|
||
# Offense count: 50
|
||
# Offense count: 49
|
||
# Configuration parameters: Include.
|
||
# Include: app/models/**/*.rb
|
||
Rails/HasManyOrHasOneDependent:
|
||
Enabled: false
|
||
|
||
# Offense count: 72
|
||
# Offense count: 73
|
||
# Configuration parameters: Include.
|
||
# Include: app/models/**/*.rb
|
||
Rails/InverseOf:
|
||
... | ... | |
Rails/Output:
|
||
Enabled: false
|
||
|
||
# Offense count: 101
|
||
# Offense count: 103
|
||
Rails/OutputSafety:
|
||
Enabled: false
|
||
|
||
... | ... | |
Rails/ReversibleMigration:
|
||
Enabled: false
|
||
|
||
# Offense count: 350
|
||
# Offense count: 359
|
||
# Configuration parameters: Blacklist.
|
||
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
|
||
Rails/SkipsModelValidations:
|
||
Enabled: false
|
||
|
||
# Offense count: 12
|
||
# Offense count: 13
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: strict, flexible
|
||
Rails/TimeZone:
|
||
... | ... | |
Security/YAMLLoad:
|
||
Enabled: false
|
||
|
||
# Offense count: 520
|
||
# Offense count: 533
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: braces, no_braces, context_dependent
|
||
Style/BracesAroundHashParameters:
|
||
Enabled: false
|
||
|
||
# Offense count: 229
|
||
# Offense count: 231
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: AutoCorrect, EnforcedStyle.
|
||
# SupportedStyles: nested, compact
|
||
... | ... | |
Style/CommentedKeyword:
|
||
Enabled: false
|
||
|
||
# Offense count: 29
|
||
# Offense count: 30
|
||
Style/DoubleNegation:
|
||
Enabled: false
|
||
|
||
... | ... | |
Style/EmptyMethod:
|
||
Enabled: false
|
||
|
||
# Offense count: 47
|
||
# Offense count: 48
|
||
# Cop supports --auto-correct.
|
||
Style/ExpandPathArguments:
|
||
Enabled: false
|
||
... | ... | |
Style/For:
|
||
Enabled: false
|
||
|
||
# Offense count: 148
|
||
# Offense count: 152
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: format, sprintf, percent
|
||
Style/FormatString:
|
||
Enabled: false
|
||
|
||
# Offense count: 378
|
||
# Offense count: 379
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: annotated, template, unannotated
|
||
Style/FormatStringToken:
|
||
... | ... | |
Style/IdenticalConditionalBranches:
|
||
Enabled: false
|
||
|
||
# Offense count: 14
|
||
# Offense count: 15
|
||
Style/IfInsideElse:
|
||
Enabled: false
|
||
|
||
... | ... | |
Style/LineEndConcatenation:
|
||
Enabled: false
|
||
|
||
# Offense count: 54
|
||
# Offense count: 61
|
||
# Cop supports --auto-correct.
|
||
Style/MethodCallWithoutArgsParentheses:
|
||
Enabled: false
|
||
|
||
# Offense count: 6
|
||
# Offense count: 5
|
||
Style/MixinUsage:
|
||
Enabled: false
|
||
|
||
# Offense count: 45
|
||
# Offense count: 37
|
||
# Cop supports --auto-correct.
|
||
Style/MultilineIfModifier:
|
||
Enabled: false
|
||
... | ... | |
Style/MultipleComparison:
|
||
Enabled: false
|
||
|
||
# Offense count: 114
|
||
# Offense count: 111
|
||
# Cop supports --auto-correct.
|
||
Style/MutableConstant:
|
||
Enabled: false
|
||
|
||
# Offense count: 21
|
||
# Offense count: 23
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle, MinBodyLength.
|
||
# SupportedStyles: skip_modifier_ifs, always
|
||
... | ... | |
Style/NumericLiteralPrefix:
|
||
Enabled: false
|
||
|
||
# Offense count: 36
|
||
# Offense count: 48
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: Strict.
|
||
Style/NumericLiterals:
|
||
MinDigits: 15
|
||
|
||
# Offense count: 18
|
||
# Offense count: 52
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: AutoCorrect, EnforcedStyle.
|
||
# SupportedStyles: predicate, comparison
|
||
... | ... | |
Style/ParallelAssignment:
|
||
Enabled: false
|
||
|
||
# Offense count: 30
|
||
# Offense count: 28
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: AllowSafeAssignment.
|
||
Style/ParenthesesAroundCondition:
|
||
Enabled: false
|
||
|
||
# Offense count: 185
|
||
# Offense count: 189
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: PreferredDelimiters.
|
||
Style/PercentLiteralDelimiters:
|
||
Enabled: false
|
||
|
||
# Offense count: 58
|
||
# Offense count: 71
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: short, verbose
|
||
... | ... | |
Style/Proc:
|
||
Enabled: false
|
||
|
||
# Offense count: 54
|
||
# Offense count: 53
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: compact, exploded
|
||
Style/RaiseArgs:
|
||
Enabled: false
|
||
|
||
# Offense count: 648
|
||
# Offense count: 684
|
||
# Cop supports --auto-correct.
|
||
Style/RedundantSelf:
|
||
Enabled: false
|
||
|
||
# Offense count: 56
|
||
# Offense count: 59
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
|
||
# SupportedStyles: slashes, percent_r, mixed
|
||
Style/RegexpLiteral:
|
||
Enabled: false
|
||
|
||
# Offense count: 56
|
||
# Offense count: 55
|
||
# Cop supports --auto-correct.
|
||
Style/RescueModifier:
|
||
Enabled: false
|
||
|
||
# Offense count: 174
|
||
# Offense count: 176
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: EnforcedStyle.
|
||
# SupportedStyles: implicit, explicit
|
||
... | ... | |
Style/StructInheritance:
|
||
Enabled: false
|
||
|
||
# Offense count: 797
|
||
# Offense count: 816
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: MinSize.
|
||
# SupportedStyles: percent, brackets
|
||
Style/SymbolArray:
|
||
EnforcedStyle: brackets
|
||
|
||
# Offense count: 85
|
||
# Offense count: 92
|
||
# Cop supports --auto-correct.
|
||
# Configuration parameters: IgnoredMethods.
|
||
# IgnoredMethods: respond_to, define_method
|
app/controllers/api/v2/autosign_controller.rb | ||
---|---|---|
end
|
||
|
||
def handle_proxy_error(exception)
|
||
render :status => 500, :json => { error: exception.message }
|
||
render :status => :internal_server_error, :json => { error: exception.message }
|
||
end
|
||
end
|
||
end
|
app/models/auth_sources/auth_source_ldap.rb | ||
---|---|---|
|
||
def validate_ldap_filter
|
||
Net::LDAP::Filter.construct(ldap_filter)
|
||
# rubocop:disable Lint/ShadowedException, Lint/UnneededCopDisableDirective
|
||
rescue Net::LDAP::Error, Net::LDAP::LdapError, Net::LDAP::FilterSyntaxInvalidError => e
|
||
# rubocop:enable Lint/ShadowedException, Lint/UnneededCopDisableDirective
|
||
message = _("invalid LDAP filter syntax")
|
||
Foreman::Logging.exception(message, e)
|
||
errors.add(:ldap_filter, message)
|
app/views/api/v2/trends/base.json.rabl | ||
---|---|---|
object @trend
|
||
|
||
attributes :id, :trendable_type, :trendable_id, :fact_name, :type, :name
|
||
attribute to_label: :label
|
||
attribute to_label: :label
|
lib/tasks/exception.rake | ||
---|---|---|
|
||
desc 'Exception utilities'
|
||
namespace :exception do
|
||
desc 'List all error codes'
|
lib/tasks/seed.rake | ||
---|---|---|
|
||
namespace :seed do
|
||
desc 'Generate various forgeries. This should not be used in production'
|
||
task :forgeries => %w[forgeries:all]
|
Also available in: Unified diff
Refs #22058 - refresh rubocop config and apply autofixes