aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2019-07-22 20:03:07 +0200
committerHans de Graaff <graaff@gentoo.org>2019-07-22 20:03:07 +0200
commit0b4cc3972482b2c15784631afe00f1d9277eb3ec (patch)
tree83271f43dd7c48811e3e02294406936f1fa36274
parentUse Ruby 2.4 as the lowest version (diff)
downloadpackages-5-0b4cc3972482b2c15784631afe00f1d9277eb3ec.tar.gz
packages-5-0b4cc3972482b2c15784631afe00f1d9277eb3ec.tar.bz2
packages-5-0b4cc3972482b2c15784631afe00f1d9277eb3ec.zip
Update rubocop configuration
Include the new performance and rails cops. Add a rubocop todo file so that running rubocop now results in a clean run. Specific issues from the todo file can be removed at a later stage. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
-rw-r--r--.rubocop.yml16
-rw-r--r--.rubocop_todo.yml814
-rw-r--r--Gemfile6
-rw-r--r--Gemfile.lock23
4 files changed, 853 insertions, 6 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 13714db..69ba68f 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,5 +1,15 @@
+inherit_from: .rubocop_todo.yml
+
+require:
+ - rubocop-performance
+ - rubocop-rails
+
AllCops:
TargetRubyVersion: 2.4
+ TargetRailsVersion: 5.2
+
+Rails:
+ Enabled: true
Style/FormatString:
Enabled: false
@@ -10,12 +20,6 @@ Style/Documentation:
Style/PerlBackrefs:
Enabled: false
-Metrics/LineLength:
- Max: 120
-
-Metrics/MethodLength:
- Max: 20
-
Metrics/ModuleLength:
Max: 200
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
new file mode 100644
index 0000000..12ec547
--- /dev/null
+++ b/.rubocop_todo.yml
@@ -0,0 +1,814 @@
+# This configuration was generated by
+# `rubocop --auto-gen-config`
+# on 2019-07-22 20:02:18 +0200 using RuboCop version 0.73.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: 1
+# Cop supports --auto-correct.
+# Configuration parameters: TreatCommentsAsGroupSeparators, Include.
+# Include: **/*.gemfile, **/Gemfile, **/gems.rb
+Bundler/OrderedGems:
+ Exclude:
+ - 'Gemfile'
+
+# Offense count: 33
+# Cop supports --auto-correct.
+# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
+# SupportedHashRocketStyles: key, separator, table
+# SupportedColonStyles: key, separator, table
+# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
+Layout/AlignHash:
+ Exclude:
+ - 'config/initializers/kkuleomi_data.rb'
+ - 'lib/kkuleomi/store.rb'
+ - 'lib/portage/util/metadata.rb'
+ - 'lib/portage/util/metadata_cache.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth.
+# SupportedStyles: case, end
+Layout/CaseIndentation:
+ Exclude:
+ - 'lib/portage/util/history.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Layout/ClosingParenthesisIndentation:
+ Exclude:
+ - 'lib/kkuleomi/store/suggester.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Layout/CommentIndentation:
+ Exclude:
+ - 'app/helpers/packages_helper.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Layout/EmptyLineAfterGuardClause:
+ Exclude:
+ - 'app/controllers/arches_controller.rb'
+ - 'lib/tasks/kkuleomi.rake'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines.
+Layout/EmptyLineBetweenDefs:
+ Exclude:
+ - 'lib/portage/repository/category.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Layout/EmptyLines:
+ Exclude:
+ - 'lib/portage/repository/category.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: around, only_before
+Layout/EmptyLinesAroundAccessModifier:
+ Exclude:
+ - 'lib/portage/repository/category.rb'
+ - 'lib/portage/repository/model.rb'
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: empty_lines, no_empty_lines
+Layout/EmptyLinesAroundBlockBody:
+ Exclude:
+ - 'test/lib/portage/util/atoms_test.rb'
+
+# Offense count: 7
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
+Layout/EmptyLinesAroundClassBody:
+ Exclude:
+ - 'app/jobs/useflags_update_job.rb'
+ - 'lib/portage/util/atoms.rb'
+ - 'test/controllers/about_controller_test.rb'
+ - 'test/controllers/index_controller_test.rb'
+ - 'test/controllers/useflags_controller_test.rb'
+ - 'test/lib/portage/util/atoms_test.rb'
+ - 'test/mailers/previews/feedback_mailer_preview.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
+Layout/ExtraSpacing:
+ Exclude:
+ - 'app/views/useflags/popular.json.jbuilder'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, IndentationWidth.
+# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
+Layout/IndentFirstArgument:
+ Exclude:
+ - 'lib/kkuleomi/store/model.rb'
+ - 'lib/kkuleomi/store/suggester.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, IndentationWidth.
+# SupportedStyles: special_inside_parentheses, consistent, align_brackets
+Layout/IndentFirstArrayElement:
+ Exclude:
+ - 'lib/kkuleomi/store.rb'
+
+# Offense count: 14
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, IndentationWidth.
+# SupportedStyles: special_inside_parentheses, consistent, align_braces
+Layout/IndentFirstHashElement:
+ Exclude:
+ - 'app/models/package.rb'
+ - 'lib/kkuleomi/store.rb'
+ - 'lib/kkuleomi/store/suggester.rb'
+ - 'test/lib/portage/util/atoms_test.rb'
+ - 'test/lib/portage/util/versions_test.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: squiggly, active_support, powerpack, unindent
+Layout/IndentHeredoc:
+ Exclude:
+ - 'app/views/about/legacy.atom.builder'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: normal, indented_internal_methods
+Layout/IndentationConsistency:
+ Exclude:
+ - 'lib/kkuleomi/store.rb'
+
+# Offense count: 5
+# Cop supports --auto-correct.
+# Configuration parameters: Width, IgnoredPatterns.
+Layout/IndentationWidth:
+ Exclude:
+ - 'config/initializers/kkuleomi_config.rb'
+ - 'config/initializers/sidekiq.rb'
+ - 'lib/kkuleomi/store.rb'
+
+# Offense count: 4
+# Cop supports --auto-correct.
+# Configuration parameters: AllowDoxygenCommentStyle.
+Layout/LeadingCommentSpace:
+ Exclude:
+ - 'app/helpers/packages_helper.rb'
+ - 'config/application.rb'
+ - 'config/environments/development.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: symmetrical, new_line, same_line
+Layout/MultilineMethodCallBraceLayout:
+ Exclude:
+ - 'app/views/feeds/changes.atom.builder'
+ - 'lib/portage/util/history.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, IndentationWidth.
+# SupportedStyles: aligned, indented
+Layout/MultilineOperationIndentation:
+ Exclude:
+ - 'lib/portage/util/atoms.rb'
+
+# Offense count: 8
+# Cop supports --auto-correct.
+# Configuration parameters: AllowForAlignment.
+Layout/SpaceAroundOperators:
+ Exclude:
+ - 'app/helpers/useflags_helper.rb'
+ - 'config/initializers/kkuleomi_config.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: AllowForAlignment.
+Layout/SpaceBeforeFirstArg:
+ Exclude:
+ - 'app/views/useflags/popular.json.jbuilder'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Layout/SpaceBeforeSemicolon:
+ Exclude:
+ - 'app/helpers/useflags_helper.rb'
+
+# Offense count: 6
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
+# SupportedStyles: space, no_space
+# SupportedStylesForEmptyBraces: space, no_space
+Layout/SpaceInsideBlockBraces:
+ Exclude:
+ - 'app/jobs/useflags_update_job.rb'
+ - 'config/initializers/core_ext.rb'
+ - 'lib/portage/repository/category.rb'
+ - 'lib/portage/repository/model.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
+# SupportedStyles: space, no_space, compact
+# SupportedStylesForEmptyBraces: space, no_space
+Layout/SpaceInsideHashLiteralBraces:
+ Exclude:
+ - 'lib/portage/util/history.rb'
+
+# Offense count: 4
+# Cop supports --auto-correct.
+Layout/SpaceInsidePercentLiteralDelimiters:
+ Exclude:
+ - 'lib/portage/util/metadata_cache.rb'
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 35
+# Cop supports --auto-correct.
+# Configuration parameters: IndentationWidth.
+Layout/Tab:
+ Exclude:
+ - 'app/helpers/packages_helper.rb'
+ - 'app/models/package.rb'
+ - 'config/initializers/kkuleomi_config.rb'
+ - 'config/initializers/sidekiq.rb'
+ - 'lib/kkuleomi/store.rb'
+
+# Offense count: 8
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: final_newline, final_blank_line
+Layout/TrailingBlankLines:
+ Exclude:
+ - 'app/views/categories/show.json.jbuilder'
+ - 'config/initializers/core_ext.rb'
+ - 'lib/core_ext/string.rb'
+ - 'lib/kkuleomi/store/suggester.rb'
+ - 'lib/portage/repository/model.rb'
+ - 'lib/portage/util.rb'
+ - 'lib/portage/util/versions.rb'
+ - 'test/lib/portage/util/atoms_test.rb'
+
+# Offense count: 10
+Lint/AmbiguousOperator:
+ Exclude:
+ - 'test/lib/portage/util/versions_test.rb'
+
+# Offense count: 1
+# Configuration parameters: AllowSafeAssignment.
+Lint/AssignmentInCondition:
+ Exclude:
+ - 'bin/spring'
+
+# Offense count: 1
+Lint/NestedMethodDefinition:
+ Exclude:
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 12
+# Configuration parameters: AllowKeywordBlockArguments.
+Lint/UnderscorePrefixedVariableName:
+ Exclude:
+ - 'app/jobs/useflags_update_job.rb'
+ - 'lib/portage/util/atoms.rb'
+ - 'lib/portage/util/history.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
+Lint/UnusedBlockArgument:
+ Exclude:
+ - 'config/initializers/elasticsearch.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
+Lint/UnusedMethodArgument:
+ Exclude:
+ - 'app/jobs/useflags_update_job.rb'
+ - 'lib/kkuleomi/store/models/version_import.rb'
+
+# Offense count: 27
+Metrics/AbcSize:
+ Max: 57
+
+# Offense count: 6
+# Configuration parameters: CountComments, ExcludedMethods.
+# ExcludedMethods: refine
+Metrics/BlockLength:
+ Max: 51
+
+# Offense count: 8
+Metrics/CyclomaticComplexity:
+ Max: 18
+
+# Offense count: 41
+# Configuration parameters: CountComments, ExcludedMethods.
+Metrics/MethodLength:
+ Max: 42
+
+# Offense count: 8
+Metrics/PerceivedComplexity:
+ Max: 19
+
+# Offense count: 1
+# Configuration parameters: EnforcedStyleForLeadingUnderscores.
+# SupportedStylesForLeadingUnderscores: disallowed, required, optional
+Naming/MemoizedInstanceVariableName:
+ Exclude:
+ - 'lib/portage/repository/model.rb'
+
+# Offense count: 3
+# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
+# NamePrefix: is_, has_, have_
+# NamePrefixBlacklist: is_, has_, have_
+# NameWhitelist: is_a?
+# MethodDefinitionMacros: define_method, define_singleton_method
+Naming/PredicateName:
+ Exclude:
+ - 'spec/**/*'
+ - 'app/models/package.rb'
+ - 'app/models/version.rb'
+ - 'lib/core_ext/string.rb'
+
+# Offense count: 21
+# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
+# AllowedNames: io, id, to, by, on, in, at, ip, db
+Naming/UncommunicativeMethodParamName:
+ Exclude:
+ - 'app/models/useflag.rb'
+ - 'app/models/version.rb'
+ - 'lib/kkuleomi/store/models/package_search.rb'
+ - 'lib/kkuleomi/store/suggester.rb'
+ - 'lib/portage/util/metadata_cache.rb'
+ - 'lib/portage/util/versions.rb'
+ - 'test/lib/portage/util/versions_test.rb'
+
+# Offense count: 4
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: snake_case, normalcase, non_integer
+Naming/VariableNumber:
+ Exclude:
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Performance/RegexpMatch:
+ Exclude:
+ - 'lib/portage/util/atoms.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
+Rails/Blank:
+ Exclude:
+ - 'app/helpers/application_helper.rb'
+ - 'lib/kkuleomi/store/models/package_search.rb'
+
+# Offense count: 1
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: slashes, arguments
+Rails/FilePath:
+ Exclude:
+ - 'config/initializers/core_ext.rb'
+
+# Offense count: 1
+# Configuration parameters: Include.
+# Include: app/controllers/**/*.rb
+Rails/LexicallyScopedActionFilter:
+ Exclude:
+ - 'app/controllers/arches_controller.rb'
+
+# Offense count: 1
+Rails/OutputSafety:
+ Exclude:
+ - 'app/helpers/packages_helper.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank.
+Rails/Present:
+ Exclude:
+ - 'app/helpers/packages_helper.rb'
+
+# Offense count: 6
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: strict, flexible
+Rails/TimeZone:
+ Exclude:
+ - 'app/views/about/legacy.atom.builder'
+ - 'app/views/feeds/changes.atom.builder'
+ - 'lib/portage/util/projects.rb'
+ - 'lib/tasks/kkuleomi.rake'
+
+# Offense count: 12
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: always, conditionals
+Style/AndOr:
+ Exclude:
+ - 'app/helpers/portage_helper.rb'
+ - 'app/models/package.rb'
+ - 'config/initializers/elasticsearch.rb'
+ - 'lib/portage/repository/category.rb'
+ - 'lib/portage/util/atoms.rb'
+ - 'lib/portage/util/metadata_cache.rb'
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners.
+# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
+# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
+# FunctionalMethods: let, let!, subject, watch
+# IgnoredMethods: lambda, proc, it
+Style/BlockDelimiters:
+ Exclude:
+ - 'lib/kkuleomi/store.rb'
+
+# Offense count: 4
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: braces, no_braces, context_dependent
+Style/BracesAroundHashParameters:
+ Exclude:
+ - 'app/controllers/concerns/package_update_feeds.rb'
+
+# Offense count: 1
+Style/CaseEquality:
+ Exclude:
+ - 'lib/core_ext/string.rb'
+
+# Offense count: 24
+# Cop supports --auto-correct.
+# Configuration parameters: AutoCorrect, EnforcedStyle.
+# SupportedStyles: nested, compact
+Style/ClassAndModuleChildren:
+ Enabled: false
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
+# SupportedStyles: assign_to_condition, assign_inside_condition
+Style/ConditionalAssignment:
+ Exclude:
+ - 'app/models/useflag.rb'
+ - 'lib/kkuleomi/util/exec.rb'
+ - 'lib/portage/util/metadata_cache.rb'
+
+# Offense count: 4
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: compact, expanded
+Style/EmptyMethod:
+ Exclude:
+ - 'app/controllers/about_controller.rb'
+ - 'app/controllers/arches_controller.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Style/ExpandPathArguments:
+ Exclude:
+ - 'Rakefile'
+ - 'test/test_helper.rb'
+
+# Offense count: 38
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: annotated, template, unannotated
+Style/FormatStringToken:
+ Exclude:
+ - 'app/controllers/packages_controller.rb'
+ - 'app/controllers/useflags_controller.rb'
+ - 'app/helpers/application_helper.rb'
+ - 'app/helpers/keywords_helper.rb'
+ - 'app/helpers/links_helper.rb'
+ - 'app/helpers/packages_helper.rb'
+ - 'app/jobs/category_update_job.rb'
+ - 'app/jobs/useflags_update_job.rb'
+ - 'app/views/feeds/changes.atom.builder'
+ - 'lib/portage/util/atoms.rb'
+ - 'lib/portage/util/maskfile.rb'
+ - 'lib/portage/util/projects.rb'
+
+# Offense count: 117
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: always, never
+Style/FrozenStringLiteralComment:
+ Enabled: false
+
+# Offense count: 9
+# Configuration parameters: MinBodyLength.
+Style/GuardClause:
+ Exclude:
+ - 'app/controllers/about_controller.rb'
+ - 'app/controllers/packages_controller.rb'
+ - 'app/jobs/package_update_job.rb'
+ - 'lib/kkuleomi/store/models/version_import.rb'
+ - 'lib/portage/repository/ebuild.rb'
+ - 'lib/portage/util/atoms.rb'
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
+# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
+Style/HashSyntax:
+ Exclude:
+ - 'app/helpers/application_helper.rb'
+
+# Offense count: 2
+Style/IdenticalConditionalBranches:
+ Exclude:
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 1
+# Configuration parameters: AllowIfModifier.
+Style/IfInsideElse:
+ Exclude:
+ - 'app/models/version.rb'
+
+# Offense count: 12
+# Cop supports --auto-correct.
+Style/IfUnlessModifier:
+ Exclude:
+ - 'app/helpers/packages_helper.rb'
+ - 'app/jobs/category_update_job.rb'
+ - 'app/jobs/package_update_job.rb'
+ - 'app/models/version.rb'
+ - 'app/views/packages/show.json.jbuilder'
+ - 'config/initializers/kkuleomi_config.rb'
+ - 'config/initializers/sidekiq.rb'
+ - 'lib/kkuleomi/store/models/package_import.rb'
+ - 'lib/portage/repository/category.rb'
+ - 'lib/portage/repository/ebuild.rb'
+ - 'lib/portage/repository/package.rb'
+ - 'lib/portage/util/atoms.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: InverseMethods, InverseBlocks.
+Style/InverseMethods:
+ Exclude:
+ - 'app/helpers/portage_helper.rb'
+ - 'app/models/package.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: IgnoredMethods.
+Style/MethodCallWithoutArgsParentheses:
+ Exclude:
+ - 'lib/kkuleomi/store/models/version_import.rb'
+
+# Offense count: 1
+Style/MixinUsage:
+ Exclude:
+ - 'bin/setup'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Style/MultilineIfModifier:
+ Exclude:
+ - 'app/helpers/keywords_helper.rb'
+ - 'lib/kkuleomi/store/models/version_import.rb'
+
+# Offense count: 10
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: literals, strict
+Style/MutableConstant:
+ Exclude:
+ - 'config/initializers/kkuleomi_config.rb'
+ - 'config/initializers/kkuleomi_constants.rb'
+ - 'config/initializers/kkuleomi_data.rb'
+
+# Offense count: 8
+# Cop supports --auto-correct.
+# Configuration parameters: Whitelist.
+# Whitelist: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with
+Style/NestedParenthesizedCalls:
+ Exclude:
+ - 'app/views/feeds/changes.atom.builder'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: predicate, comparison
+Style/NilComparison:
+ Exclude:
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: IncludeSemanticChanges.
+Style/NonNilCheck:
+ Exclude:
+ - 'lib/portage/util/metadata_cache.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Style/Not:
+ Exclude:
+ - 'app/helpers/portage_helper.rb'
+ - 'app/models/package.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: Strict.
+Style/NumericLiterals:
+ MinDigits: 6
+
+# Offense count: 12
+# Cop supports --auto-correct.
+# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
+# SupportedStyles: predicate, comparison
+Style/NumericPredicate:
+ Exclude:
+ - 'spec/**/*'
+ - 'lib/kkuleomi/store/models/package_import.rb'
+ - 'lib/portage/util/atoms.rb'
+ - 'lib/portage/util/history.rb'
+ - 'lib/portage/util/versions.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Style/ParallelAssignment:
+ Exclude:
+ - 'lib/portage/util/history.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: PreferredDelimiters.
+Style/PercentLiteralDelimiters:
+ Exclude:
+ - 'config/application.rb'
+ - 'config/initializers/kkuleomi_config.rb'
+ - 'lib/kkuleomi/store.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: short, verbose
+Style/PreferredHashMethods:
+ Exclude:
+ - 'app/jobs/record_change_job.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
+# SupportedStyles: slashes, percent_r, mixed
+Style/RegexpLiteral:
+ Exclude:
+ - 'app/helpers/useflags_helper.rb'
+ - 'lib/portage/util/atoms.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Style/RescueModifier:
+ Exclude:
+ - 'lib/kkuleomi/store.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: implicit, explicit
+Style/RescueStandardError:
+ Exclude:
+ - 'app/controllers/application_controller.rb'
+ - 'lib/portage/util/masks.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist.
+# Whitelist: present?, blank?, presence, try, try!
+Style/SafeNavigation:
+ Exclude:
+ - 'lib/portage/util/atoms.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: AllowAsExpressionSeparator.
+Style/Semicolon:
+ Exclude:
+ - 'app/helpers/useflags_helper.rb'
+
+# Offense count: 11
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: only_raise, only_fail, semantic
+Style/SignalException:
+ Exclude:
+ - 'app/controllers/arches_controller.rb'
+ - 'app/controllers/categories_controller.rb'
+ - 'app/controllers/packages_controller.rb'
+ - 'app/controllers/useflags_controller.rb'
+ - 'lib/kkuleomi/store/models/package_import.rb'
+ - 'lib/portage/repository/ebuild.rb'
+ - 'lib/portage/repository/package.rb'
+ - 'lib/portage/util/history.rb'
+ - 'lib/tasks/kkuleomi.rake'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: .
+# SupportedStyles: use_perl_names, use_english_names
+Style/SpecialGlobalVars:
+ EnforcedStyle: use_perl_names
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Style/StderrPuts:
+ Exclude:
+ - 'bin/yarn'
+
+# Offense count: 27
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
+# SupportedStyles: single_quotes, double_quotes
+Style/StringLiterals:
+ Exclude:
+ - 'bin/spring'
+ - 'bin/yarn'
+ - 'config/application.rb'
+ - 'config/initializers/kkuleomi_config.rb'
+ - 'config/initializers/sidekiq.rb'
+ - 'test/controllers/about_controller_test.rb'
+ - 'test/controllers/categories_controller_test.rb'
+ - 'test/controllers/index_controller_test.rb'
+ - 'test/controllers/useflags_controller_test.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, MinSize.
+# SupportedStyles: percent, brackets
+Style/SymbolArray:
+ Exclude:
+ - 'app/controllers/arches_controller.rb'
+ - 'app/models/useflag.rb'
+ - 'config/routes.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: IgnoredMethods.
+# IgnoredMethods: respond_to, define_method
+Style/SymbolProc:
+ Exclude:
+ - 'lib/portage/repository/model.rb'
+ - 'lib/portage/util/history.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyleForMultiline.
+# SupportedStylesForMultiline: comma, consistent_comma, no_comma
+Style/TrailingCommaInArguments:
+ Exclude:
+ - 'lib/kkuleomi/store/models/package_search.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyleForMultiline.
+# SupportedStylesForMultiline: comma, consistent_comma, no_comma
+Style/TrailingCommaInArrayLiteral:
+ Exclude:
+ - 'lib/kkuleomi/store.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyleForMultiline.
+# SupportedStylesForMultiline: comma, consistent_comma, no_comma
+Style/TrailingCommaInHashLiteral:
+ Exclude:
+ - 'lib/kkuleomi/store.rb'
+ - 'lib/kkuleomi/store/models/package_search.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Style/UnlessElse:
+ Exclude:
+ - 'app/controllers/useflags_controller.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Style/UnneededInterpolation:
+ Exclude:
+ - 'lib/portage/repository/package.rb'
+
+# Offense count: 110
+# Cop supports --auto-correct.
+# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
+# URISchemes: http, https
+Metrics/LineLength:
+ Max: 150
diff --git a/Gemfile b/Gemfile
index 6a1809c..6d9041c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -55,6 +55,12 @@ group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 3.0'
+ # Rubocop modules to help with consistent style and to avoid common
+ # issues.
+ gem 'rubocop', '0.73.0'
+ gem 'rubocop-performance', '1.4.0'
+ gem 'rubocop-rails', '2.2.1'
+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 5208cbe..6303e27 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -43,6 +43,7 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (9.0.0)
+ ast (2.4.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
@@ -91,6 +92,7 @@ GEM
i18n (1.6.0)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
+ jaro_winkler (1.5.3)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
jquery-rails (4.3.5)
@@ -123,6 +125,9 @@ GEM
octicons_helper (9.1.1)
octicons (= 9.1.1)
rails
+ parallel (1.17.0)
+ parser (2.6.3.0)
+ ast (~> 2.4.0)
rack (2.0.7)
rack-protection (2.0.5)
rack
@@ -156,6 +161,7 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
+ rainbow (3.0.0)
rake (12.3.3)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
@@ -163,6 +169,19 @@ GEM
rdiscount (2.2.0.1)
rdoc (6.1.1)
redis (4.1.2)
+ rubocop (0.73.0)
+ jaro_winkler (~> 1.5.1)
+ parallel (~> 1.10)
+ parser (>= 2.6)
+ rainbow (>= 2.2.2, < 4.0)
+ ruby-progressbar (~> 1.7)
+ unicode-display_width (>= 1.4.0, < 1.7)
+ rubocop-performance (1.4.0)
+ rubocop (>= 0.71.0)
+ rubocop-rails (2.2.1)
+ rack (>= 1.1)
+ rubocop (>= 0.72.0)
+ ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
sass (3.7.4)
sass-listen (~> 4.0.0)
@@ -204,6 +223,7 @@ GEM
thread_safe (~> 0.1)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
+ unicode-display_width (1.6.0)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
@@ -233,6 +253,9 @@ DEPENDENCIES
rails (~> 5.2.3)
rails-controller-testing
rdiscount
+ rubocop (= 0.73.0)
+ rubocop-performance (= 1.4.0)
+ rubocop-rails (= 2.2.1)
sass-rails (~> 5.0)
sdoc (~> 1.0)
sidekiq