Skip to content

Commit 92abd60

Browse files
stefannibrasilthdaraujo
authored andcommitted
Merge pull request #3052 from faker-ruby/sb-bump-rubocop-minitest
Bump rubocop-minitest and fix rubocop's offense
2 parents 1fd67e9 + 73ea7b2 commit 92abd60

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ gem 'minitest', '5.25.4'
1010
gem 'pry', '0.15.2'
1111
gem 'rake', '13.2.1'
1212
gem 'rubocop', '1.73.0'
13-
gem 'rubocop-minitest', '0.36.0'
13+
gem 'rubocop-minitest', '0.37.0'
1414
gem 'rubocop-rake', '0.6.0'
1515
gem 'simplecov', '0.22.0'
1616
gem 'test-unit', '3.6.7'

Gemfile.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ GEM
4444
unicode-display_width (>= 2.4.0, < 4.0)
4545
rubocop-ast (1.38.1)
4646
parser (>= 3.3.1.0)
47-
rubocop-minitest (0.36.0)
47+
rubocop-minitest (0.37.0)
48+
lint_roller (~> 1.1)
4849
rubocop (>= 1.61, < 2.0)
49-
rubocop-ast (>= 1.31.1, < 2.0)
50+
rubocop-ast (>= 1.38.0, < 2.0)
5051
rubocop-rake (0.6.0)
5152
rubocop (~> 1.0)
5253
ruby-progressbar (1.13.0)
@@ -75,7 +76,7 @@ DEPENDENCIES
7576
pry (= 0.15.2)
7677
rake (= 13.2.1)
7778
rubocop (= 1.73.0)
78-
rubocop-minitest (= 0.36.0)
79+
rubocop-minitest (= 0.37.0)
7980
rubocop-rake (= 0.6.0)
8081
simplecov (= 0.22.0)
8182
test-unit (= 3.6.7)

lib/helpers/deprecator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def self.skip_warning
103103
end
104104

105105
def self.skip_warning?
106-
skip == true
106+
@skip == true
107107
end
108108

109109
def self.skip

tasks/reformat_yaml.rake

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
require 'yaml'
44

5+
desc 'Reformat all locales'
6+
task :reformat_locales do
7+
path = File.absolute_path(File.join(__dir__, '..', 'lib', 'locales', '**', '*.yml'))
8+
locales = Dir[path]
9+
failures = []
10+
11+
locales.each do |locale_path|
12+
reformat_file(locale_path)
13+
rescue StandardError => e
14+
failures << "Error reformatting #{locale_path}: #{e.message}"
15+
end
16+
17+
puts failures
18+
end
19+
520
desc 'Reformat a yaml file into a common format'
621
task :reformat_yaml, [:filename] do |_, args|
722
args.with_defaults(filename: nil)
@@ -16,7 +31,7 @@ end
1631
def reformat_file(filename)
1732
puts "Reformatting #{filename}"
1833

19-
input = YAML.load_file(filename)
34+
input = YAML.safe_load_file(filename, aliases: true)
2035
# Psych outputs non-indented hypendated array list items.
2136
output = input.to_yaml(line_width: -1)
2237
.gsub(/(^ *- .+$)/, ' \1') # Indent hyphenated list items

0 commit comments

Comments
 (0)