Skip to content

Commit

Permalink
Merge pull request #196 from betagouv/feat/rails8
Browse files Browse the repository at this point in the history
feat: move to ViewComponent 3 + Rails 8
  • Loading branch information
freesteph authored Jan 6, 2025
2 parents 36a964c + 23a5efb commit f431bab
Show file tree
Hide file tree
Showing 32 changed files with 417 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
ruby: ['3.2.6', '3.3.6']
rails: ['6.1.5', '7.0.3']
rails: ['8.0.1']
runs-on: ubuntu-latest
name: Testing with Ruby ${{ matrix.ruby }} and Rails ${{ matrix.rails }}
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ spec/dummy/tmp/
spec/dummy/node_modules/
spec/dummy/public/assets/
spec/dummy/config/master.key
spec/dummy/app/assets/builds
coverage
*.gem
.tool-versions
Expand Down
160 changes: 93 additions & 67 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-12-09 16:36:08 UTC using RuboCop version 1.39.0.
# on 2025-01-03 11:06:15 UTC using RuboCop version 1.69.2.
# 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: 21
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
# SupportedStyles: Gemfile, gems.rb, gemspec
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
Gemspec/DevelopmentDependencies:
Exclude:
- 'dsfr-view-components.gemspec'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemspec
Gemspec/OrderedDependencies:
Exclude:
- 'dsfr-view-components.gemspec'

# Offense count: 1
# Configuration parameters: Include.
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'dsfr-view-components.gemspec'

# Offense count: 8
# Offense count: 20
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: IndentationWidth.
# SupportedStyles: outdent, indent
Layout/AccessModifierIndentation:
EnforcedStyle: outdent

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLines:
Exclude:
- 'dsfr-view-components.gemspec'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
Expand All @@ -28,16 +50,6 @@ Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'spec/dummy/db/schema.rb'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Exclude:
- 'app/helpers/dsfr_link_helper.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
Expand Down Expand Up @@ -69,37 +81,24 @@ Lint/EmptyBlock:
- 'config/routes.rb'
- 'spec/dummy/db/schema.rb'

# Offense count: 3
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/RedundantDirGlobSort:
# Configuration parameters: AllowedImplicitNamespaces.
# AllowedImplicitNamespaces: Gem
Lint/RaiseException:
Exclude:
- 'guide/lib/helpers.rb'
- 'lib/dsfr/components/engine.rb'
- 'spec/spec_helper.rb'
- 'scripts/deploy_gem.rb'

# Offense count: 2
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 19

# Offense count: 3
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 13

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 106

# Offense count: 2
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
Metrics/ParameterLists:
Max: 6

# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, BlockForwardingName.
# SupportedStyles: anonymous, explicit
Naming/BlockForwarding:
Exclude:
- 'app/helpers/dsfr_link_helper.rb'

# Offense count: 6
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
Expand All @@ -113,17 +112,12 @@ RSpec/ContextWording:

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle.
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
Exclude:
- 'spec/components/dsfr_component/accordion_component_spec.rb'

# Offense count: 3
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 14

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
RSpec/LeadingSubject:
Expand All @@ -132,21 +126,13 @@ RSpec/LeadingSubject:
- 'spec/components/shared/a_component_with_a_slot_that_accepts_custom_classes.rb'
- 'spec/components/shared/a_component_with_a_slot_that_accepts_custom_html_attributes.rb'

# Offense count: 3
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
Rails/FilePath:
Exclude:
- 'spec/dummy/config/environments/development.rb'
- 'spec/dummy/config/environments/production.rb'

# Offense count: 2
Rails/OutputSafety:
Exclude:
- 'app/components/dsfr_component/header_component/direct_link_dropdown_component.rb'
- 'app/helpers/dsfr_back_to_top_link_helper.rb'
- 'guide/lib/helpers/content_helpers.rb'

# Offense count: 2
# Offense count: 3
Security/Eval:
Exclude:
- 'guide/lib/helpers/formatters.rb'
Expand All @@ -159,7 +145,7 @@ Style/Alias:
Exclude:
- 'app/components/dsfr_component/accordion_component/section_component.rb'

# Offense count: 6
# Offense count: 14
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: nested, compact
Expand All @@ -169,15 +155,23 @@ Style/ClassAndModuleChildren:
- 'app/components/dsfr_component/accordion_component/section_component.rb'
- 'app/components/dsfr_component/alert_component.rb'
- 'app/components/dsfr_component/base.rb'
- 'app/components/dsfr_component/breadcrumbs_component.rb'
- 'app/components/dsfr_component/header_component.rb'
- 'app/components/dsfr_component/header_component/direct_link_component.rb'
- 'app/components/dsfr_component/header_component/direct_link_dropdown_component.rb'
- 'app/components/dsfr_component/header_component/operator_image_component.rb'
- 'app/components/dsfr_component/header_component/tool_link_component.rb'
- 'app/components/dsfr_component/tabs_component.rb'
- 'app/components/dsfr_component/tabs_component/tab_component.rb'
- 'app/components/dsfr_component/traits.rb'
- 'spec/spec_helper.rb'

# Offense count: 24
# Offense count: 47
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false

# Offense count: 73
# Offense count: 104
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Expand All @@ -190,19 +184,34 @@ Style/GlobalStdStream:
Exclude:
- 'spec/dummy/config/environments/production.rb'

# Offense count: 1
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/KeywordArgumentsMerging:
Exclude:
- 'spec/components/shared/a_component_that_accepts_custom_classes.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: line_count_dependent, lambda, literal
Style/Lambda:
Exclude:
- 'app/components/dsfr_component/accordion_component.rb'
- 'app/components/dsfr_component/breadcrumbs_component.rb'

# Offense count: 3
Style/MixinUsage:
Exclude:
- 'spec/spec_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'dsfr-view-components.gemspec'

# Offense count: 3
Style/OpenStructUse:
Exclude:
Expand All @@ -217,11 +226,10 @@ Style/PercentLiteralDelimiters:
- 'app/components/dsfr_component/accordion_component.rb'
- 'app/components/dsfr_component/alert_component.rb'
- 'app/helpers/dsfr_link_helper.rb'
- 'dsfr-view-components.gemspec'
- 'lib/dsfr/components/engine.rb'
- 'spec/components/shared/a_component_that_accepts_custom_classes.rb'

# Offense count: 4
# Offense count: 47
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: .
# SupportedStyles: same_as_string_literals, single_quotes, double_quotes
Expand All @@ -235,6 +243,20 @@ Style/RedundantFetchBlock:
Exclude:
- 'spec/dummy/config/puma.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantLineContinuation:
Exclude:
- 'app/components/dsfr_component/header_component/direct_link_component.rb'
- 'app/components/dsfr_component/header_component/direct_link_dropdown_component.rb'
- 'app/components/dsfr_component/tag_component.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpArgument:
Exclude:
- 'guide/lib/helpers/formatters.rb'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantStringEscape:
Expand All @@ -249,14 +271,13 @@ Style/RegexpLiteral:
Exclude:
- 'guide/lib/helpers/formatters.rb'

# Offense count: 7
# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: only_raise, only_fail, semantic
Style/SignalException:
Exclude:
- 'app/components/dsfr_component/alert_component.rb'
- 'app/helpers/dsfr_link_helper.rb'
- 'guide/lib/filters/dart_sass.rb'
- 'guide/lib/suppress_listen_symlink_errors.rb'
- 'lib/dsfr/components/helpers/css_utilities.rb'
Expand All @@ -268,26 +289,31 @@ Style/StringConcatenation:
Exclude:
- 'spec/components/shared/setup.rb'

# Offense count: 286
# Offense count: 793
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Enabled: false

# Offense count: 4
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/SuperArguments:
Exclude:
- 'app/components/dsfr_component/accordion_component.rb'
- 'app/components/dsfr_component/breadcrumbs_component.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'app/helpers/dsfr_link_helper.rb'
- 'guide/lib/helpers/content_helpers.rb'
- 'lib/dsfr/components/engine.rb'

# Offense count: 8
# Offense count: 30
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# URISchemes: http, https
Layout/LineLength:
Max: 199
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ group 'nanoc' do
gem 'nanoc-live'
end

gem "rubocop-rspec", "~> 2.14"
gem "cssbundling-rails"
gem "rubocop-rails"
gem "rubocop-rspec"
Loading

0 comments on commit f431bab

Please sign in to comment.