From 38ed49dca2b2e77c4cd46723650529efbb0e9878 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 14 May 2024 10:53:39 -0400 Subject: [PATCH] Upgraded RuboCop to 1.63.5. --- .github/workflows/ci.yml | 5 +++-- .rspec | 5 +++++ .rubocop.yml | 1 + CHANGELOG.md | 1 + Gemfile | 2 +- .../strategies/figures_converter/languages/lv.rb | 2 +- .../strategies/figures_converter/languages/pt-BR.rb | 4 ++-- lib/numbers_and_words/translations/es.rb | 2 +- lib/numbers_and_words/translations/et.rb | 2 +- lib/numbers_and_words/translations/fr.rb | 4 ++-- lib/numbers_and_words/translations/hu.rb | 2 +- lib/numbers_and_words/translations/it.rb | 2 +- lib/numbers_and_words/translations/nl.rb | 2 +- lib/numbers_and_words/translations/pt.rb | 2 +- lib/numbers_and_words/translations/se.rb | 2 +- 15 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 .rspec diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 296c0d86..e61811df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,8 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.image }} + bundler-cache: true - name: Run tests run: | - gem install -g - rake + bundle install + bundle exec rake diff --git a/.rspec b/.rspec new file mode 100644 index 00000000..27a9fb77 --- /dev/null +++ b/.rspec @@ -0,0 +1,5 @@ +--require spec_helper +--color +--format=documentation +--order=rand +--warnings diff --git a/.rubocop.yml b/.rubocop.yml index 55beb101..08182161 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,6 +8,7 @@ AllCops: TargetRubyVersion: 2.7 Exclude: - 'numbers_and_words.gemspec' + - vendor/bundle/**/* Layout/EmptyLinesAroundAttributeAccessor: Enabled: true diff --git a/CHANGELOG.md b/CHANGELOG.md index f0904e45..e6a50d1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.11.13 (Next) ### Features + * Upgrade RuboCop to 1.63.5. \[[#198](https://github.com/kslazarev/numbers_and_words/pull/198)\] * Your contribution here. ## 0.11.12 (April 22, 2023) diff --git a/Gemfile b/Gemfile index 3ab7e70b..bcbdb4e2 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ end group :test do gem 'coveralls', require: false gem 'rspec', '~> 3' - gem 'rubocop', require: false + gem 'rubocop', '~> 1.63.5', require: false gem 'rubocop-performance', require: false gem 'rubocop-rake', require: false gem 'rubocop-rspec', require: false diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb b/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb index 2a3ad28a..1708605d 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb @@ -6,7 +6,7 @@ module FiguresConverter module Languages class Lv < Base def tens_with_ones - super separator: ' ' + super(separator: ' ') end def megs diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb b/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb index fd4ec6d1..63a59844 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb @@ -31,7 +31,7 @@ def capacity_iteration end def ones - super internal_options.merge(is_one_thousand: one_thousand?) + super(internal_options.merge(is_one_thousand: one_thousand?)) end def hundreds @@ -56,7 +56,7 @@ def maybe_ordinal end def gender - return (options.gender.result || :male) if maybe_ordinal + return options.gender.result || :male if maybe_ordinal if current_capacity&.positive? && figures[0] == 1 :male diff --git a/lib/numbers_and_words/translations/es.rb b/lib/numbers_and_words/translations/es.rb index 3786c6dc..0bebd97b 100644 --- a/lib/numbers_and_words/translations/es.rb +++ b/lib/numbers_and_words/translations/es.rb @@ -19,7 +19,7 @@ def ones(number, options = {}) end def tens_with_ones(numbers, options = {}) - super numbers, options.merge(separator: " #{union} ") + super(numbers, options.merge(separator: " #{union} ")) end def twenties_with_ones(numbers, options = {}) diff --git a/lib/numbers_and_words/translations/et.rb b/lib/numbers_and_words/translations/et.rb index 44c138a9..7fcc37ab 100644 --- a/lib/numbers_and_words/translations/et.rb +++ b/lib/numbers_and_words/translations/et.rb @@ -6,7 +6,7 @@ class Et < Base include NumbersAndWords::Translations::Families::Latin def hundreds(number, _options = {}) - super number, separator: '' + super(number, separator: '') end end end diff --git a/lib/numbers_and_words/translations/fr.rb b/lib/numbers_and_words/translations/fr.rb index 742a6066..11f31114 100644 --- a/lib/numbers_and_words/translations/fr.rb +++ b/lib/numbers_and_words/translations/fr.rb @@ -11,14 +11,14 @@ class Fr < Base def tens(number, options = {}) return t(:eighty) if number == SPECIAL_TENS_CASE && options[:alone].nil? - super number, options + super(number, options) end def tens_with_ones(numbers, options = {}) return [tens(numbers[1] - 1, alone: false), teens(numbers)].join('-') if [7, 9].include? numbers[1] separator = numbers[0] == 1 ? " #{union} " : '-' - super numbers, options.merge(separator: separator) + super(numbers, options.merge(separator: separator)) end def hundreds(number, options = {}) diff --git a/lib/numbers_and_words/translations/hu.rb b/lib/numbers_and_words/translations/hu.rb index db697c62..ed58516c 100644 --- a/lib/numbers_and_words/translations/hu.rb +++ b/lib/numbers_and_words/translations/hu.rb @@ -12,7 +12,7 @@ def tens_with_ones(numbers, options = {}) end def hundreds(number, options = {}) - super number, options.merge(separator: '') + super(number, options.merge(separator: '')) end end end diff --git a/lib/numbers_and_words/translations/it.rb b/lib/numbers_and_words/translations/it.rb index f7b875f8..518f9e6d 100644 --- a/lib/numbers_and_words/translations/it.rb +++ b/lib/numbers_and_words/translations/it.rb @@ -6,7 +6,7 @@ class It < Base include NumbersAndWords::Translations::Families::Latin def tens_with_ones(numbers, _options = {}) - super numbers, separator: '' + super(numbers, separator: '') end def hundreds(number, _options = {}) diff --git a/lib/numbers_and_words/translations/nl.rb b/lib/numbers_and_words/translations/nl.rb index 3298e9dd..f2e6318e 100644 --- a/lib/numbers_and_words/translations/nl.rb +++ b/lib/numbers_and_words/translations/nl.rb @@ -12,7 +12,7 @@ def tens_with_ones(numbers, _options = {}) def hundreds(number, _options = {}) return t(:hundreds) if number == 1 - super number, separator: '' + super(number, separator: '') end private diff --git a/lib/numbers_and_words/translations/pt.rb b/lib/numbers_and_words/translations/pt.rb index 51069faa..20a6ac03 100644 --- a/lib/numbers_and_words/translations/pt.rb +++ b/lib/numbers_and_words/translations/pt.rb @@ -6,7 +6,7 @@ class Pt < Base include NumbersAndWords::Translations::Families::Latin def tens_with_ones(numbers, _options = {}) - super numbers, separator: " #{union} " + super(numbers, separator: " #{union} ") end def hundreds(number, options = {}) diff --git a/lib/numbers_and_words/translations/se.rb b/lib/numbers_and_words/translations/se.rb index 6677810a..fcf6071f 100644 --- a/lib/numbers_and_words/translations/se.rb +++ b/lib/numbers_and_words/translations/se.rb @@ -6,7 +6,7 @@ class Se < Base include NumbersAndWords::Translations::Families::Latin def tens_with_ones(numbers, _options = {}) - super numbers, separator: '-' + super(numbers, separator: '-') end end end