Skip to content

Commit

Permalink
Bump rubocop to 0.88.0
Browse files Browse the repository at this point in the history
  • Loading branch information
feelepxyz committed Jul 17, 2020
1 parent cadb0cd commit fb50ec5
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 27 deletions.
44 changes: 37 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Layout/DotPosition:
EnforcedStyle: trailing

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: false
Enabled: false

Layout/LineLength:
Max: 80
Expand All @@ -21,7 +21,7 @@ Layout/RescueEnsureAlignment:
Enabled: false

Layout/SpaceAroundMethodCallOperator:
Enabled: false
Enabled: false

Lint/DeprecatedOpenSSLConstant:
Enabled: false
Expand All @@ -42,7 +42,7 @@ Metrics/ModuleLength:
Max: 350

Metrics/CyclomaticComplexity:
Max: 10
Max: 15

Metrics/AbcSize:
Max: 35
Expand Down Expand Up @@ -73,14 +73,14 @@ Style/Documentation:
Enabled: false

Style/HashEachMethods:
Enabled: false
Enabled: false

Style/HashTransformKeys:
Enabled: false

Style/HashTransformValues:
Enabled: false

Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%i': ()
Expand All @@ -98,4 +98,34 @@ Style/RedundantRegexpEscape:
Enabled: false

Style/SlicingWithRange:
Enabled: false
Enabled: false

Style/RedundantFetchBlock:
Enabled: false

Lint/DuplicateElsifCondition:
Enabled: false

Style/AccessorGrouping:
Enabled: false

Style/ArrayCoercion:
Enabled: false

Style/BisectedAttrAccessor:
Enabled: false

Style/CaseLikeIf:
Enabled: false

Style/HashAsLastArrayItem:
Enabled: false

Style/HashLikeCase:
Enabled: false

Style/RedundantAssignment:
Enabled: false

Style/RedundantFileExtensionInRequire:
Enabled: false
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace :ci do
packages = changed_packages
puts "Running rubocop on: #{packages.join(', ')}"
packages.each do |package|
run_command("cd #{package} && bundle exec rubocop")
run_command("cd #{package} && bundle exec rubocop -c ../.rubocop.yml")
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def dependency_files
).prepared_dependency_files
end

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def fetch_latest_resolvable_version_details
return latest_version_details unless gemfile
Expand Down Expand Up @@ -117,7 +116,6 @@ def fetch_latest_resolvable_version_details
@gemspec_ruby_unlocked = true
regenerate_dependency_files_without_ruby_lock && retry
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def circular_dependency_at_new_version?(error)
Expand Down
3 changes: 2 additions & 1 deletion cargo/lib/dependabot/cargo/file_updater/lockfile_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def handle_cargo_error(error)
end

# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/CyclomaticComplexity
def better_specification_needed?(error)
return false if @custom_specification
return false unless error.message.match?(/specification .* is ambigu/)
Expand Down Expand Up @@ -95,7 +96,7 @@ def better_specification_needed?(error)
@custom_specification = spec_options.first
true
end

# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def dependency_spec
Expand Down
5 changes: 2 additions & 3 deletions cargo/lib/dependabot/cargo/update_checker/version_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def fetch_version_from_new_lockfile
end

# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/CyclomaticComplexity
def better_specification_needed?(error)
return false if @custom_specification
return false unless error.message.match?(/specification .* is ambigu/)
Expand Down Expand Up @@ -107,7 +108,7 @@ def better_specification_needed?(error)
@custom_specification = spec_options.first
true
end

# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def dependency_spec
Expand Down Expand Up @@ -169,7 +170,6 @@ def check_rust_workspace_root
end

# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/MethodLength
def handle_cargo_errors(error)
Expand Down Expand Up @@ -238,7 +238,6 @@ def handle_cargo_errors(error)
raise error
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Metrics/MethodLength

Expand Down
2 changes: 1 addition & 1 deletion common/dependabot-common.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec", "~> 3.8"
spec.add_development_dependency "rspec-its", "~> 1.2"
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4"
spec.add_development_dependency "rubocop", "~> 0.85.0"
spec.add_development_dependency "rubocop", "~> 0.88.0"
spec.add_development_dependency "vcr", "6.0.0"
spec.add_development_dependency "webmock", "~> 3.4"

Expand Down
2 changes: 0 additions & 2 deletions common/lib/dependabot/git_metadata_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def head_commit_for_ref(ref)

attr_reader :url, :credentials

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def fetch_upload_pack_for(uri)
response = fetch_raw_upload_pack_for(uri)
Expand Down Expand Up @@ -79,7 +78,6 @@ def fetch_upload_pack_for(uri)

raise Dependabot::GitDependenciesNotReachable, [uri]
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def fetch_raw_upload_pack_for(uri)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def upgrade_guide_text

private

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def changelog
return unless changelog_from_suggested_url || source
Expand All @@ -98,7 +97,6 @@ def changelog
# Fall back to the changelog (or nil) from the default branch
default_branch_changelog
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def changelog_from_suggested_url
Expand Down
2 changes: 2 additions & 0 deletions hex/lib/dependabot/hex/update_checker/file_preparer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def updated_version_requirement_string(filename)

# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/CyclomaticComplexity
def updated_version_req_lower_bound(filename)
original_req = dependency.requirements.
find { |r| r.fetch(:file) == filename }&.
Expand All @@ -120,6 +121,7 @@ def updated_version_req_lower_bound(filename)
">= #{parts.join('.')}"
end
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/PerceivedComplexity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def requirements_for_path(requirements, path)
end

# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/MethodLength
def handle_yarn_lock_updater_error(error, yarn_lock)
Expand Down Expand Up @@ -255,7 +254,6 @@ def handle_yarn_lock_updater_error(error, yarn_lock)
raise error
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Metrics/MethodLength

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def get_element_from_node(node)
node.at_xpath("/DevelopmentDependency")
end

# rubocop:disable Metrics/CyclomaticComplexity
def fetch_declaration_strings
deep_find_declarations(declaring_file.content).select do |nd|
node = Nokogiri::XML(nd)
Expand All @@ -66,6 +67,7 @@ def fetch_declaration_strings
node_requirement == declaring_requirement.fetch(:requirement)
end
end
# rubocop:enable Metrics/CyclomaticComplexity

def get_node_version_value(node)
attribute = "Version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def config_file_repositories
config_files.flat_map { |file| repos_from_config_file(file) }
end

# rubocop:disable Metrics/CyclomaticComplexity
def repos_from_config_file(config_file)
doc = Nokogiri::XML(config_file.content)
doc.remove_namespaces!
Expand Down Expand Up @@ -178,6 +179,7 @@ def repos_from_config_file(config_file)

sources
end
# rubocop:enable Metrics/CyclomaticComplexity

def default_repository_details
{
Expand Down
2 changes: 1 addition & 1 deletion omnibus/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ gem "dependabot-composer", path: "../composer"
gem "dependabot-dep", path: "../dep"
gem "dependabot-docker", path: "../docker"
gem "dependabot-elm", path: "../elm"
gem "dependabot-git_submodules", path: "../git_submodules"
gem "dependabot-github_actions", path: "../github_actions"
gem "dependabot-git_submodules", path: "../git_submodules"
gem "dependabot-go_modules", path: "../go_modules"
gem "dependabot-gradle", path: "../gradle"
gem "dependabot-hex", path: "../hex"
Expand Down
2 changes: 1 addition & 1 deletion omnibus/dependabot-omnibus.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
spec.add_dependency "dependabot-dep", Dependabot::VERSION
spec.add_dependency "dependabot-docker", Dependabot::VERSION
spec.add_dependency "dependabot-elm", Dependabot::VERSION
spec.add_dependency "dependabot-git_submodules", Dependabot::VERSION
spec.add_dependency "dependabot-github_actions", Dependabot::VERSION
spec.add_dependency "dependabot-git_submodules", Dependabot::VERSION
spec.add_dependency "dependabot-go_modules", Dependabot::VERSION
spec.add_dependency "dependabot-gradle", Dependabot::VERSION
spec.add_dependency "dependabot-hex", Dependabot::VERSION
Expand Down
2 changes: 0 additions & 2 deletions python/lib/dependabot/python/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def normalise_prerelease(version)
# TODO: Delete this once we're using a version of Rubygems that includes
# https://github.com/rubygems/rubygems/pull/2651
#
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Style/CaseEquality
# rubocop:disable Layout/LineLength
Expand Down Expand Up @@ -146,7 +145,6 @@ def old_comp(other)

return 0
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Style/CaseEquality
# rubocop:enable Layout/LineLength
Expand Down
2 changes: 0 additions & 2 deletions terraform/lib/dependabot/terraform/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ def get_proxied_source(raw_source)
end&.attributes&.fetch("content", nil)&.value
end

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def source_type(source_string)
return :path if source_string.start_with?(".")
Expand All @@ -213,7 +212,6 @@ def source_type(source_string)

raise "HTTP source, but not an archive!"
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def parsed_file(file)
Expand Down

0 comments on commit fb50ec5

Please sign in to comment.