Skip to content

Commit

Permalink
Merge pull request #917 from fosterful/hint/chore/misc-dev-test-updates
Browse files Browse the repository at this point in the history
Misc dev/test updates
  • Loading branch information
benjaminwood authored Nov 3, 2023
2 parents 31d1b19 + d3f8b91 commit 41c0ae4
Show file tree
Hide file tree
Showing 39 changed files with 384 additions and 281 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,15 @@ jobs:
PR_TITLE: ${{ github.event.pull_request.title }}

steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.5'
bundler-cache: true

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
Expand Down
134 changes: 102 additions & 32 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,127 @@
inherit_gem:
hint-rubocop_style:
- default.yml
inherit_from: .rubocop_todo.yml

require:
- rubocop-rspec
- rubocop-rails
- rubocop-performance
- rubocop-capybara
- rubocop-factory_bot

Rails:
Enabled: true

AllCops:
TargetRubyVersion: 3.0.5
TargetRailsVersion: 6.1
NewCops: enable
DisplayCopNames: true
Exclude:
- 'bin/**/*'
- 'config/**/*'
- 'db/**/*'
- 'Gemfile*'
- 'node_modules/**/*'
- 'script/**/*'
- 'spec/**/*'
- 'vendor/**/*'
- bin/**/*
- config/**/*
- db/**/*
- Gemfile*
- node_modules/**/*
- script/**/*
- spec/**/*
- vendor/**/*
- '**/*.haml'
- 'config.ru'
- config.ru

Rails/HasAndBelongsToMany:
Enabled: false
Rails/SkipsModelValidations:
Enabled: false
Style/PercentLiteralDelimiters:
PreferredDelimiters:
default: ()
'%i': ()
'%I': ()
'%r': ()
'%w': ()
'%W': ()
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
Layout/EmptyLinesAroundClassBody:
Enabled: false
Layout/MultilineMethodCallIndentation:
Enabled: false
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Layout/LineLength:
Max: 243
Metrics/BlockLength:
Exclude:
- 'lib/tasks/**/*'
- 'spec/**/*'

- Rakefile
- '**/*.rake'
- spec/**/*.rb
- lib/tasks/**/*
- spec/**/*
Metrics/ModuleLength:
Max: 200
Metrics/ClassLength:
Max: 200

Rails/HasAndBelongsToMany:
Enabled: false

Metrics/MethodLength:
Max: 20

Metrics/AbcSize:
Max: 30

Max: 35
Layout/CaseIndentation:
Enabled: true
EnforcedStyle: case
IndentOneStep: true
Style/AndOr:
Enabled: false
Style/SignalException:
Enabled: false
AutoCorrect: false
Style/GlobalVars:
Enabled: false

RSpec/ImplicitBlockExpectation:
Layout/SpaceBeforeBlockBraces:
AutoCorrect: true
Layout/ExtraSpacing:
AutoCorrect: true
AllowForAlignment: true
ForceEqualSignAlignment: false
Layout/EmptyLines:
AutoCorrect: true
Layout/MultilineOperationIndentation:
Enabled: true
EnforcedStyle: indented
Performance/Count:
Enabled: false

RSpec/MessageChain:
Style/NumericLiterals:
Enabled: false

RSpec/EmptyExampleGroup:
Style/RedundantFreeze:
Enabled: false

Rails/SkipsModelValidations:
Layout/SpaceAroundOperators:
Enabled: false
RSpec/ExampleLength:
Max: 19
RSpec/MultipleExpectations:
Max: 10
RSpec/NamedSubject:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/LetSetup:
Enabled: false
RSpec/NestedGroups:
Enabled: false
RSpec/ImplicitBlockExpectation:
Enabled: false
RSpec/MessageChain:
Enabled: false

RSpec/MessageSpies:
Enabled: false

RSpec/AnyInstance:
Enabled: false
Security/YAMLLoad:
Enabled: false
Naming/FileName:
Enabled: false
Style/Documentation:
Enabled: false
RSpec/EmptyExampleGroup:
Enabled: false
71 changes: 71 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-11-03 23:21:49 UTC using RuboCop version 1.57.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: 9
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 243

# Offense count: 1
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
Lint/DuplicateBranch:
Exclude:
- 'app/policies/user_policy.rb'

# Offense count: 2
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Exclude:
- 'app/policies/dashboard_policy.rb'
- 'app/policies/user_policy.rb'

# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 34

# Offense count: 4
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 81

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 8

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 9

# Offense count: 2
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/need.rb'
- 'app/models/user.rb'

# Offense count: 16
Rails/I18nLocaleTexts:
Exclude:
- 'app/admin/site_status.rb'
- 'app/admin/users.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/needs_controller.rb'
- 'app/controllers/shift_surveys_controller.rb'
- 'app/controllers/shifts_controller.rb'
- 'app/controllers/verifications_controller.rb'
- 'app/mailers/user_mailer.rb'
- 'app/models/age_range.rb'
- 'app/models/need.rb'
- 'app/models/user.rb'
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console'
gem 'listen'
gem 'hint-rubocop_style'
gem 'rubocop'
gem 'rubocop-rails'
gem 'rubocop-rspec'
gem 'rubocop-performance'
end

group :test do
Expand Down
Loading

0 comments on commit 41c0ae4

Please sign in to comment.