Commit 380c6ad6 authored by Gabriel Mazetto's avatar Gabriel Mazetto 🚀

Update rubocop to latest version (0.59.0)

parent 286c4196
......@@ -272,10 +272,15 @@ Style/StringMethods:
Enabled: true
# This cop checks for trailing comma in array and hash literals.
Style/TrailingCommaInLiteral:
Style/TrailingCommaInArrayLiteral:
Enabled: true
EnforcedStyleForMultiline: no_comma
Style/TrailingCommaInHashLiteral:
Enabled: true
EnforcedStyleForMultiline: no_comma
# This cop checks for trailing comma in argument lists.
Style/TrailingCommaInArguments:
Enabled: true
......@@ -489,10 +494,6 @@ Layout/SpaceBeforeComment:
Layout/SpaceBeforeSemicolon:
Enabled: true
# Checks for spaces inside square brackets.
Layout/SpaceInsideBrackets:
Enabled: true
# Use spaces inside hash literal braces - or don't.
Layout/SpaceInsideHashLiteralBraces:
Enabled: true
......@@ -581,7 +582,7 @@ Lint/AssignmentInCondition:
Enabled: false
# Align block ends correctly.
Lint/BlockAlignment:
Layout/BlockAlignment:
Enabled: true
# Default values in optional keyword arguments and optional ordinal arguments
......@@ -590,7 +591,7 @@ Lint/CircularArgumentReference:
Enabled: true
# Checks for condition placed in a confusing position relative to the keyword.
Lint/ConditionPosition:
Layout/ConditionPosition:
Enabled: true
# Check for debugger calls.
......@@ -598,7 +599,7 @@ Lint/Debugger:
Enabled: true
# Align ends corresponding to defs correctly.
Lint/DefEndAlignment:
Layout/DefEndAlignment:
Enabled: true
# Check for deprecated class method calls.
......@@ -622,7 +623,7 @@ Lint/EmptyWhen:
Enabled: true
# Align ends correctly.
Lint/EndAlignment:
Layout/EndAlignment:
Enabled: true
# END blocks should not be placed inside method definitions.
......@@ -655,15 +656,6 @@ Lint/ImplicitStringConcatenation:
Lint/IneffectiveAccessModifier:
Enabled: false
# Checks for invalid character literals with a non-escaped whitespace
# character.
Lint/InvalidCharacterLiteral:
Enabled: true
# Checks of literals used in conditions.
Lint/LiteralInCondition:
Enabled: true
# Checks for literals used in interpolation.
Lint/LiteralInInterpolation:
Enabled: true
......@@ -718,12 +710,6 @@ Lint/UnderscorePrefixedVariableName:
Lint/UnifiedInteger:
Enabled: true
# Checks for rubocop:disable comments that can be removed.
# Note: this cop is not disabled when disabling all cops.
# It must be explicitly disabled.
Lint/UnneededDisable:
Enabled: false
# This cop checks for unneeded usages of splat expansion
Lint/UnneededSplatExpansion:
Enabled: false
......
......@@ -41,5 +41,5 @@ group :development, :test do
gem 'docopt'
gem 'scss_lint', require: false
gem 'rspec', '~> 3.5', require: false
gem 'rubocop', '~> 0.50.0', require: false
gem 'rubocop', '~> 0.59.0', require: false
end
......@@ -8,7 +8,7 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
ast (2.3.0)
ast (2.4.0)
autoprefixer-rails (6.7.7.1)
execjs
backports (3.8.0)
......@@ -72,6 +72,7 @@ GEM
multi_xml (>= 0.5.2)
i18n (0.7.0)
i18n_data (0.8.0)
jaro_winkler (1.5.1)
kramdown (1.13.2)
libv8 (6.7.288.46.1)
listen (3.0.8)
......@@ -146,17 +147,16 @@ GEM
tilt (>= 1.4.1, < 3)
padrino-support (0.13.3.3)
activesupport (>= 3.1)
parallel (1.11.2)
parser (2.4.0.0)
ast (~> 2.2)
powerpack (0.1.1)
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
powerpack (0.1.2)
public_suffix (2.0.5)
rack (2.0.3)
rack-livereload (0.3.16)
rack
rainbow (2.2.2)
rake
rake (12.0.0)
rainbow (3.0.0)
rake (12.3.1)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
......@@ -174,14 +174,15 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubocop (0.50.0)
rubocop (0.59.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.3.3.1, < 3.0)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 3.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
ruby-progressbar (1.10.0)
sass (3.4.24)
sassc (1.11.1)
bundler
......@@ -204,7 +205,7 @@ GEM
thread_safe (~> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.3.0)
unicode-display_width (1.4.0)
unicode_utils (1.4.0)
yell (2.0.7)
......@@ -230,7 +231,7 @@ DEPENDENCIES
mini_racer (~> 0.1)
nokogiri (>= 1.8.3)
rspec (~> 3.5)
rubocop (~> 0.50.0)
rubocop (~> 0.59.0)
sassc
scss_lint
stringex
......
......@@ -305,7 +305,7 @@ task :new_post, :title do |t, args|
filename = "source/posts/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.html.md.erb"
puts "Creating new post: #{filename}"
open(filename, 'w') do |post|
File.open(filename, 'w') do |post|
post.puts '---'
post.puts "title: \"#{title.gsub(/&/, '&amp;')}\""
post.puts 'author: Firstname Lastname # if name includes special characters use double quotes "First Last"'
......@@ -330,7 +330,7 @@ namespace :release do
desc 'Creates a new release post for major and minor versions'
task :monthly, :version do |t, args|
version = args.version
source_dir = File.expand_path('../source', __FILE__)
source_dir = File.expand_path('source', __dir__)
date = Time.now.strftime('%Y-%m-22')
posts_dir = 'posts'
......@@ -350,7 +350,7 @@ namespace :release do
md_text.gsub!('X.X', version)
md_text.gsub!('X-X', version.tr('.', '-'))
open(md_filename, 'w') do |post|
File.open(md_filename, 'w') do |post|
post.puts md_text
end
......@@ -369,7 +369,7 @@ namespace :release do
yaml_text.gsub!('X.X', version)
yaml_text.gsub!('X-X', version.tr('.', '-'))
open(yaml_filename, 'w') do |yaml|
File.open(yaml_filename, 'w') do |yaml|
yaml.puts yaml_text
end
end
......@@ -378,7 +378,7 @@ namespace :release do
desc 'Creates a new release post for patch versions'
task :patch, :version do |t, args|
version = args.version
source_dir = File.expand_path('../source', __FILE__)
source_dir = File.expand_path('source', __dir__)
posts_dir = 'posts'
raise 'You need to specify a patch version, like 10.1.1' unless /\A\d+\.\d+\.\d+\z/.match?(version)
......@@ -398,7 +398,7 @@ namespace :release do
template_text.gsub!('X.X', version)
template_text.gsub!('X-X', version.tr('.', '-'))
open(filename, 'w') do |post|
File.open(filename, 'w') do |post|
post.puts template_text
end
end
......@@ -406,7 +406,7 @@ end
desc 'Create a new press release'
task :new_press, :title do |t, args|
data_dir = File.expand_path('../data', __FILE__)
data_dir = File.expand_path('data', __dir__)
puts 'Enter a date for the press release (ISO format, example: 2016-12-30): '
date = STDIN.gets.chomp
......@@ -415,7 +415,7 @@ task :new_press, :title do |t, args|
filename = "source/press/releases/#{date}-#{title.to_url}.html.md"
puts "Creating new press release: #{filename}"
open(filename, 'w') do |pressrel|
File.open(filename, 'w') do |pressrel|
pressrel.puts '---'
pressrel.puts 'layout: markdown_page'
pressrel.puts "title: \"#{title.gsub(/&/, '&amp;')}\""
......@@ -425,7 +425,7 @@ task :new_press, :title do |t, args|
press_yml = "#{data_dir}/press.yml"
puts 'Populating data/press.yml'
open(press_yml, 'a') do |yaml|
File.open(press_yml, 'a') do |yaml|
yaml.puts ''
yaml.puts "- title: \"#{title.gsub(/&/, '&amp;')}\""
yaml.puts " link: #{date}-#{title.to_url}.html"
......@@ -435,7 +435,7 @@ end
desc 'Add an existing press release to the archive'
task :add_press, :title do |t, args|
data_dir = File.expand_path('../data', __FILE__)
data_dir = File.expand_path('data', __dir__)
puts 'Enter a date for the press release (ISO format, example: 2016-12-30): '
date = STDIN.gets.chomp
......@@ -446,7 +446,7 @@ task :add_press, :title do |t, args|
press_yml = "#{data_dir}/press.yml"
puts 'Populating data/press.yml'
open(press_yml, 'a') do |yaml|
File.open(press_yml, 'a') do |yaml|
yaml.puts ''
yaml.puts "- title: \"#{title}\""
yaml.puts " link: #{link}"
......@@ -470,7 +470,7 @@ PDF_TEMPLATE = 'pdf_template.tex'.freeze
# public/foo/bar.pdf depends on public/foo/bar.html
rule %r{^public/.*\.pdf} => [->(f) { f.pathmap('%X.html') }, PDF_TEMPLATE] do |pdf|
# Avoid distracting 'newline appended' message
open(pdf.source, 'a', &:puts)
File.open(pdf.source, 'a', &:puts)
# Rewrite the generated HTML to fix image links for pandoc. Image paths
# need to be relative paths starting with 'public/'.
IO.popen(%W[ed -s #{pdf.source}], 'w') do |ed|
......
......@@ -96,6 +96,7 @@ proxy '/company/team/org-chart/index.html', '/company/team/org-chart/template.ht
# Proxy Comparison html and PDF pages
data.features.competitors.each_key do |competitor|
next if competitor[0..6] == 'gitlab_'
file_name = "#{competitor}-vs-gitlab".tr('_', '-')
proxy "/devops-tools/#{file_name}.html", "/templates/comparison.html", locals: {
key_one: competitor,
......@@ -128,6 +129,7 @@ end
# Event pages
data.events.each do |event|
next unless event.url
proxy "/events/#{event.url.tr(' ', '-')}/index.html", '/events/template.html', locals: {
event: event
}, ignore: true
......
......@@ -234,6 +234,7 @@ def generate_direction(stages)
milestones.each do |ms|
next unless ms['due_date'] && Date.parse(ms['due_date']) >= Date.today
issues = []
edition.each do |project|
......@@ -298,7 +299,7 @@ def edition
end
def gitlaborg
@group ||= begin
@gitlaborg ||= begin
com = GitLabInstance.new('GitLab.com')
GitLabGroup.new('gitlab-org', com)
end
......
......@@ -62,7 +62,7 @@ class ReleaseList
end
def relative_url
format('/%d/%0.2d/%0.2d/%s', date.year, date.month, date.day, title)
format('/%<year>d/%<month>0.2d/%<day>0.2d/%<title>s', year: date.year, month: date.month, day: date.day, title: title)
end
# Returns an Array of "highlights"
......
......@@ -81,10 +81,14 @@ module Gitlab
##
# Middeman Data File objects compatibiltiy
#
def method_missing(name, *args, &block) # rubocop:disable Style/MethodMissing
def method_missing(name, *args, &block) # rubocop:disable Style/MethodMissingSuper
@data[name.to_s]
end
def respond_to_missing?(method_name, include_private = false)
@data.include?(method_name.to_s) || super
end
def self.all!
@members ||= YAML.load_file('data/team.yml')
@titles ||= {}.tap do |hash|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment