Skip to content

Commit

Permalink
Merge branch 'master' into rubocop-challenge/20240104233316
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin authored Jan 17, 2024
2 parents 5c38fdf + 42a03d8 commit 6de7f34
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
gemfile: ['rails-7.0.x', 'rails-6.1.x']
gemfile: ['rails-7.1.x', 'rails-7.0.x', 'rails-6.1.x']
ruby: [3.2, 3.1, '3.0']
include:
- gemfile: rails-7.0.x
Expand Down
41 changes: 11 additions & 30 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 180`
# on 2024-01-04 23:33:26 UTC using RuboCop version 1.59.0.
# on 2024-01-16 23:33:30 UTC using RuboCop version 1.60.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'Gemfile'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
Expand Down Expand Up @@ -80,14 +72,6 @@ Layout/EmptyLines:
Exclude:
- 'lib/excel_templating/excel_abstraction/work_book.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: around, only_before
Layout/EmptyLinesAroundAccessModifier:
Exclude:
- 'lib/excel_templating/render_helper.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
Expand Down Expand Up @@ -127,13 +111,6 @@ Layout/IndentationWidth:
Exclude:
- 'lib/excel_templating/excel_abstraction/work_book.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
Layout/LeadingCommentSpace:
Exclude:
- 'lib/excel_templating/renderer.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
Expand All @@ -142,12 +119,6 @@ Layout/MultilineOperationIndentation:
Exclude:
- 'lib/excel_templating/document/data_source_registry/registry_renderer.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/SpaceAfterComma:
Exclude:
- 'spec/cell_validation_spec.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
Expand Down Expand Up @@ -320,6 +291,16 @@ Style/Alias:
- 'lib/excel_templating/excel_abstraction/cell_range.rb'
- 'lib/excel_templating/excel_abstraction/row.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames.
# RedundantRestArgumentNames: args, arguments
# RedundantKeywordRestArgumentNames: kwargs, options, opts
# RedundantBlockArgumentNames: blk, block, proc
Style/ArgumentsForwarding:
Exclude:
- 'lib/excel_templating/document.rb'

# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
Expand Down
7 changes: 0 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
source 'https://rubygems.org'

gemspec

group :development do
gem 'kramdown'
gem 'rubocop'
gem 'byebug'
gem 'gemfury'
end
1 change: 0 additions & 1 deletion gemfiles/Gemfile.rails-7.0.x
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ source 'https://rubygems.org'
gemspec path: '../'

gem 'activerecord', '~> 7.0.0'
gem 'writeexcel', github: 'mathieujobin/writeexcel', branch: 'ruby3.3-rebased'

6 changes: 6 additions & 0 deletions gemfiles/Gemfile.rails-7.1.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gemspec path: '../'

gem 'activerecord', '~> 7.1.2'

1 change: 1 addition & 0 deletions lib/excel_templating/render_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def letter_for(one_based_index)
end

private

def letters
@row_letters ||= ('A' .. 'ZZ').to_a
end
Expand Down
4 changes: 2 additions & 2 deletions lib/excel_templating/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ def whole_cell_template?(template)
def add_validation(sheet, row_number, column_number)
raise ArgumentError, "No :data_sources defined for validation!" unless data_source_registry
source = sheet.validation_source_name(row_number, column_number)
#Use current_row and current_col here because row_number and column_number refer to the template
#sheet and we want to write a reference to the cell we just wrote
# Use current_row and current_col here because row_number and column_number refer to the template
# sheet and we want to write a reference to the cell we just wrote
active_sheet.data_validation absolute_reference(current_row + 1, current_col),
registry_renderer.absolute_reference_for(source)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/cell_validation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SimpleFromDataValidatedDocument < ExcelTemplating::Document
{
all_sheets:
{
valid_foos: ["foo","bar"],
valid_foos: ["foo", "bar"],
valid_value: "foo",
}
}
Expand Down

0 comments on commit 6de7f34

Please sign in to comment.