Bump rubocop
This commit is contained in:
parent
09b36924c3
commit
98ff15591e
9 changed files with 27 additions and 17 deletions
10
.rubocop.yml
10
.rubocop.yml
|
|
@ -190,6 +190,16 @@ Layout/EmptyLineBetweenDefs:
|
||||||
Style/NumericPredicate:
|
Style/NumericPredicate:
|
||||||
EnforcedStyle: comparison
|
EnforcedStyle: comparison
|
||||||
|
|
||||||
|
# disable this for now, needs to be rechecked later
|
||||||
|
Style/DateTime:
|
||||||
|
Exclude:
|
||||||
|
- "lib/diaspora_federation/discovery/xrd_document.rb"
|
||||||
|
- "spec/lib/diaspora_federation/discovery/xrd_document_spec.rb"
|
||||||
|
|
||||||
|
# broken in 0.52.1
|
||||||
|
Layout/EmptyLinesAroundArguments:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
### backward compatibility
|
### backward compatibility
|
||||||
|
|
||||||
# only with ruby >= 2.3
|
# only with ruby >= 2.3
|
||||||
|
|
|
||||||
2
Gemfile
2
Gemfile
|
|
@ -19,7 +19,7 @@ group :development do
|
||||||
# code style
|
# code style
|
||||||
gem "pronto", "0.9.5", require: false
|
gem "pronto", "0.9.5", require: false
|
||||||
gem "pronto-rubocop", "0.9.0", require: false
|
gem "pronto-rubocop", "0.9.0", require: false
|
||||||
gem "rubocop", "0.50.0", require: false
|
gem "rubocop", "0.52.1", require: false
|
||||||
|
|
||||||
# automatic test runs
|
# automatic test runs
|
||||||
gem "guard-rspec", require: false
|
gem "guard-rspec", require: false
|
||||||
|
|
|
||||||
14
Gemfile.lock
14
Gemfile.lock
|
|
@ -118,9 +118,9 @@ GEM
|
||||||
rspec (>= 2.99, >= 2.14.2, < 4)
|
rspec (>= 2.99, >= 2.14.2, < 4)
|
||||||
octokit (4.7.0)
|
octokit (4.7.0)
|
||||||
sawyer (~> 0.8.0, >= 0.5.3)
|
sawyer (~> 0.8.0, >= 0.5.3)
|
||||||
parallel (1.12.0)
|
parallel (1.12.1)
|
||||||
parser (2.4.0.0)
|
parser (2.4.0.2)
|
||||||
ast (~> 2.2)
|
ast (~> 2.3)
|
||||||
powerpack (0.1.1)
|
powerpack (0.1.1)
|
||||||
pronto (0.9.5)
|
pronto (0.9.5)
|
||||||
gitlab (~> 4.0, >= 4.0.0)
|
gitlab (~> 4.0, >= 4.0.0)
|
||||||
|
|
@ -183,11 +183,11 @@ GEM
|
||||||
rspec-mocks (~> 3.7.0)
|
rspec-mocks (~> 3.7.0)
|
||||||
rspec-support (~> 3.7.0)
|
rspec-support (~> 3.7.0)
|
||||||
rspec-support (3.7.0)
|
rspec-support (3.7.0)
|
||||||
rubocop (0.50.0)
|
rubocop (0.52.1)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 2.3.3.1, < 3.0)
|
parser (>= 2.4.0.2, < 3.0)
|
||||||
powerpack (~> 0.1)
|
powerpack (~> 0.1)
|
||||||
rainbow (>= 2.2.2, < 3.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (~> 1.0, >= 1.0.1)
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||||
ruby-progressbar (1.9.0)
|
ruby-progressbar (1.9.0)
|
||||||
|
|
@ -253,7 +253,7 @@ DEPENDENCIES
|
||||||
rspec-collection_matchers (~> 1.1.2)
|
rspec-collection_matchers (~> 1.1.2)
|
||||||
rspec-json_expectations (~> 2.1)
|
rspec-json_expectations (~> 2.1)
|
||||||
rspec-rails (~> 3.7.0)
|
rspec-rails (~> 3.7.0)
|
||||||
rubocop (= 0.50.0)
|
rubocop (= 0.52.1)
|
||||||
simplecov (= 0.15.1)
|
simplecov (= 0.15.1)
|
||||||
simplecov-rcov (= 0.2.3)
|
simplecov-rcov (= 0.2.3)
|
||||||
spring
|
spring
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ Gem::Specification.new do |s|
|
||||||
|
|
||||||
s.required_ruby_version = "~> 2.1"
|
s.required_ruby_version = "~> 2.1"
|
||||||
|
|
||||||
s.add_dependency "nokogiri", "~> 1.6", ">= 1.6.8"
|
|
||||||
s.add_dependency "faraday", ">= 0.9.0", "< 0.14.0"
|
s.add_dependency "faraday", ">= 0.9.0", "< 0.14.0"
|
||||||
s.add_dependency "faraday_middleware", ">= 0.10.0", "< 0.13.0"
|
s.add_dependency "faraday_middleware", ">= 0.10.0", "< 0.13.0"
|
||||||
|
s.add_dependency "nokogiri", "~> 1.6", ">= 1.6.8"
|
||||||
s.add_dependency "typhoeus", "~> 1.0"
|
s.add_dependency "typhoeus", "~> 1.0"
|
||||||
s.add_dependency "valid", "~> 1.0"
|
s.add_dependency "valid", "~> 1.0"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ module DiasporaFederation
|
||||||
person
|
person
|
||||||
rescue DiscoveryError
|
rescue DiscoveryError
|
||||||
raise # simply re-raise DiscoveryError
|
raise # simply re-raise DiscoveryError
|
||||||
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
|
rescue => e # rubocop:disable Style/RescueStandardError
|
||||||
raise DiscoveryError, "Failed discovery for #{diaspora_id}: #{e.class}: #{e.message}"
|
raise DiscoveryError, "Failed discovery for #{diaspora_id}: #{e.class}: #{e.message}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ module DiasporaFederation
|
||||||
response = HttpClient.get(url)
|
response = HttpClient.get(url)
|
||||||
raise "Failed to fetch #{url}: #{response.status}" unless response.success?
|
raise "Failed to fetch #{url}: #{response.status}" unless response.success?
|
||||||
response.body
|
response.body
|
||||||
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
|
rescue => e # rubocop:disable Style/RescueStandardError
|
||||||
unless http_fallback && url.start_with?("https://")
|
unless http_fallback && url.start_with?("https://")
|
||||||
raise DiscoveryError, "Failed to fetch #{url} for #{diaspora_id}: #{e.class}: #{e.message}"
|
raise DiscoveryError, "Failed to fetch #{url} for #{diaspora_id}: #{e.class}: #{e.message}"
|
||||||
end
|
end
|
||||||
|
|
@ -78,7 +78,7 @@ module DiasporaFederation
|
||||||
|
|
||||||
# This tries the WebFinger URL with https first, then falls back to http if webfinger_http_fallback is enabled.
|
# This tries the WebFinger URL with https first, then falls back to http if webfinger_http_fallback is enabled.
|
||||||
@webfinger = WebFinger.from_json(get(webfinger_url, DiasporaFederation.webfinger_http_fallback))
|
@webfinger = WebFinger.from_json(get(webfinger_url, DiasporaFederation.webfinger_http_fallback))
|
||||||
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
|
rescue => e # rubocop:disable Style/RescueStandardError
|
||||||
logger.warn "WebFinger failed, retrying with legacy WebFinger for #{diaspora_id}: #{e.class}: #{e.message}"
|
logger.warn "WebFinger failed, retrying with legacy WebFinger for #{diaspora_id}: #{e.class}: #{e.message}"
|
||||||
@webfinger = WebFinger.from_xml(get(legacy_webfinger_url_from_host_meta))
|
@webfinger = WebFinger.from_xml(get(legacy_webfinger_url_from_host_meta))
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ module DiasporaFederation
|
||||||
class_name = Entity.entity_class(type).to_s.rpartition("::").last
|
class_name = Entity.entity_class(type).to_s.rpartition("::").last
|
||||||
return if DiasporaFederation.callbacks.trigger(:fetch_related_entity, class_name, guid)
|
return if DiasporaFederation.callbacks.trigger(:fetch_related_entity, class_name, guid)
|
||||||
Fetcher.fetch_public(author, type, guid)
|
Fetcher.fetch_public(author, type, guid)
|
||||||
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
|
rescue => e # rubocop:disable Style/RescueStandardError
|
||||||
logger.error "Failed to fetch linked entity #{type}:#{guid}: #{e.class}: #{e.message}"
|
logger.error "Failed to fetch linked entity #{type}:#{guid}: #{e.class}: #{e.message}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ module DiasporaFederation
|
||||||
type = entity_name(entity_type).to_s
|
type = entity_name(entity_type).to_s
|
||||||
raise "Already fetching ..." if fetching[type].include?(guid)
|
raise "Already fetching ..." if fetching[type].include?(guid)
|
||||||
fetch_from_url(author, type, guid)
|
fetch_from_url(author, type, guid)
|
||||||
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
|
rescue => e # rubocop:disable Style/RescueStandardError
|
||||||
raise NotFetchable, "Failed to fetch #{entity_type}:#{guid} from #{author}: #{e.class}: #{e.message}"
|
raise NotFetchable, "Failed to fetch #{entity_type}:#{guid} from #{author}: #{e.class}: #{e.message}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ module DiasporaFederation
|
||||||
Salmon::MagicEnvelope.unenvelop(magic_env_xml)
|
Salmon::MagicEnvelope.unenvelop(magic_env_xml)
|
||||||
end
|
end
|
||||||
Public.new(magic_env).receive
|
Public.new(magic_env).receive
|
||||||
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
|
rescue => e # rubocop:disable Style/RescueStandardError
|
||||||
logger.error "failed to receive public message: #{e.class}: #{e.message}"
|
logger.error "failed to receive public message: #{e.class}: #{e.message}"
|
||||||
logger.debug "received data:\n#{data}"
|
logger.debug "received data:\n#{data}"
|
||||||
raise e
|
raise e
|
||||||
|
|
@ -36,7 +36,7 @@ module DiasporaFederation
|
||||||
Salmon::MagicEnvelope.unenvelop(magic_env_xml)
|
Salmon::MagicEnvelope.unenvelop(magic_env_xml)
|
||||||
end
|
end
|
||||||
Private.new(magic_env, recipient_id).receive
|
Private.new(magic_env, recipient_id).receive
|
||||||
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
|
rescue => e # rubocop:disable Style/RescueStandardError
|
||||||
logger.error "failed to receive private message for #{recipient_id}: #{e.class}: #{e.message}"
|
logger.error "failed to receive private message for #{recipient_id}: #{e.class}: #{e.message}"
|
||||||
logger.debug "received data:\n#{data}"
|
logger.debug "received data:\n#{data}"
|
||||||
raise e
|
raise e
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ module DiasporaFederation
|
||||||
# Validates and receives the entity
|
# Validates and receives the entity
|
||||||
def receive
|
def receive
|
||||||
validate_and_receive
|
validate_and_receive
|
||||||
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
|
rescue => e # rubocop:disable Style/RescueStandardError
|
||||||
logger.error "failed to receive #{entity}"
|
logger.error "failed to receive #{entity}"
|
||||||
raise e
|
raise e
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue