Upgrade to Rubocop 0.70

This commit is contained in:
Simone Carletti 2019-05-27 10:00:28 +02:00
parent 2803479f5a
commit d3ea96c432
18 changed files with 40 additions and 14 deletions

View File

@ -63,11 +63,6 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false
# [codesmell]
# I don't really get the point of this cop.
Performance/RedundantMerge:
Enabled: false
# Do not use "and" or "or" in conditionals, but for readability we can use it
# to chain executions. Just beware of operator order.
Style/AndOr:
@ -123,12 +118,12 @@ Style/RescueStandardError:
# Array indentation should be considered like MultilineMethodCallIndentation indentation
# and use 4 spaces instead of 2.
Layout/IndentArray:
Layout/IndentFirstArrayElement:
IndentationWidth: 4
# Hash indentation should be considered like MultilineMethodCallIndentation indentation
# and use 4 spaces instead of 2.
Layout/IndentHash:
Layout/IndentFirstHashElement:
IndentationWidth: 4
# Multi-line differs from standard indentation, they are indented twice.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
source "https://rubygems.org"
gemspec

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "bundler/gem_tasks"
# By default, run tests and linter.
@ -39,7 +41,7 @@ desc "Downloads the Public Suffix List file from the repository and stores it lo
task :"update-list" do
require "net/http"
DEFINITION_URL = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat".freeze
DEFINITION_URL = "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat"
File.open("data/list.txt", "w+") do |f|
response = Net::HTTP.get_response(URI.parse(DEFINITION_URL))

View File

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "bundler/setup"
require "public_suffix"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# = Public Suffix
#
# Domain name parser based on the Public Suffix List.
@ -20,9 +22,9 @@ require_relative "public_suffix/list"
# but was originally created to meet the needs of browser manufacturers.
module PublicSuffix
DOT = ".".freeze
BANG = "!".freeze
STAR = "*".freeze
DOT = "."
BANG = "!"
STAR = "*"
# Parses +name+ and returns the {PublicSuffix::Domain} instance.
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# = Public Suffix
#
# Domain name parser based on the Public Suffix List.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# = Public Suffix
#
# Domain name parser based on the Public Suffix List.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# = Public Suffix
#
# Domain name parser based on the Public Suffix List.
@ -65,8 +67,8 @@ module PublicSuffix
# @param private_domains [Boolean] whether to ignore the private domains section
# @return [PublicSuffix::List]
def self.parse(input, private_domains: true)
comment_token = "//".freeze
private_token = "===BEGIN PRIVATE DOMAINS===".freeze
comment_token = "//"
private_token = "===BEGIN PRIVATE DOMAINS==="
section = nil # 1 == ICANN, 2 == PRIVATE
new do |list|

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# = Public Suffix
#
# Domain name parser based on the Public Suffix List.

View File

@ -9,5 +9,5 @@
module PublicSuffix
# The current library version.
VERSION = "3.0.3".freeze
VERSION = "3.0.3"
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class AcceptanceTest < Minitest::Test

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
require "public_suffix"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class PublicSuffix::DomainTest < Minitest::Test

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class ErrorsTest < Minitest::Test

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class PublicSuffix::ListTest < Minitest::Test

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class PublicSuffixTest < Minitest::Test

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class PublicSuffix::RuleTest < Minitest::Test