Skip to content

Commit

Permalink
DEV: Enable more rules (#37)
Browse files Browse the repository at this point in the history
* DEV: Update dependencies
* Enable some low hanging rubocop-rspec fruits
  • Loading branch information
CvX committed Dec 12, 2023
1 parent 2c4c03d commit 8b5bf28
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 26 deletions.
77 changes: 73 additions & 4 deletions rubocop-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ Style/GlobalVars:
Enabled: true
Severity: warning
Exclude:
- 'lib/tasks/**/*'
- 'script/**/*'
- 'spec/**/*.rb'
- 'plugins/*/spec/**/*'
- "lib/tasks/**/*"
- "script/**/*"
- "spec/**/*.rb"
- "plugins/*/spec/**/*"

Style/InvertibleUnlessCondition:
Enabled: true
Expand Down Expand Up @@ -69,3 +69,72 @@ Bundler/OrderedGems:

Layout/LineLength:
Enabled: false

Lint/ParenthesesAsGroupedExpression:
Enabled: true

Lint/DuplicateMethods:
Enabled: true

Lint/RedundantWithIndex:
Enabled: true

Lint/RedundantRequireStatement:
Enabled: true

Lint/LiteralInInterpolation:
Enabled: true

Lint/RedundantStringCoercion:
Enabled: true

Lint/BooleanSymbol:
Enabled: true

Lint/ShadowedArgument:
Enabled: true

Lint/RedundantCopDisableDirective:
Enabled: true

Lint/EmptyEnsure:
Enabled: true

Lint/RedundantWithObject:
Enabled: true

Lint/SelfAssignment:
Enabled: true

Lint/Void:
Enabled: true

Lint/UselessMethodDefinition:
Enabled: true

Lint/UnreachableCode:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true

Lint/DisjunctiveAssignmentInConstructor:
Enabled: true

Lint/NonLocalExitFromIterator:
Enabled: true

Lint/DeprecatedClassMethods:
Enabled: true

Lint/SafeNavigationChain:
Enabled: true

Lint/RedundantSafeNavigation:
Enabled: true

Lint/EmptyConditionalBody:
Enabled: true

Lint/SafeNavigationConsistency:
Enabled: true
10 changes: 5 additions & 5 deletions rubocop-discourse.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = "rubocop-discourse"
s.version = "3.4.1"
s.version = "3.5.0"
s.summary = "Custom rubocop cops used by Discourse"
s.authors = ["Discourse Team"]
s.license = "MIT"
Expand All @@ -11,9 +11,9 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split($/)
s.require_paths = ["lib"]

s.add_runtime_dependency "rubocop", ">= 1.1.0"
s.add_runtime_dependency "rubocop-rspec", ">= 2.0.0"
s.add_runtime_dependency "rubocop", ">= 1.59.0"
s.add_runtime_dependency "rubocop-rspec", ">= 2.25.0"

s.add_development_dependency "rake", "~> 13.0"
s.add_development_dependency "rspec"
s.add_development_dependency "rake", "~> 13.1.0"
s.add_development_dependency "rspec", "~> 3.12.0"
end
43 changes: 26 additions & 17 deletions rubocop-rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ RSpec/ContextWording:
RSpec/DescribeClass:
Enabled: true
Exclude:
- '**/spec/features/**/*'
- '**/spec/requests/**/*'
- '**/spec/routing/**/*'
- '**/spec/system/**/*'
- '**/spec/views/**/*'
- '**/spec/initializers/**/*'
- '**/spec/integration/**/*'
- '**/spec/integrity/**/*'
- '**/spec/tasks/**/*'
- '**/spec/lib/freedom_patches/**/*'
- '**/spec/multisite/**/*'
- "**/spec/features/**/*"
- "**/spec/requests/**/*"
- "**/spec/routing/**/*"
- "**/spec/system/**/*"
- "**/spec/views/**/*"
- "**/spec/initializers/**/*"
- "**/spec/integration/**/*"
- "**/spec/integrity/**/*"
- "**/spec/tasks/**/*"
- "**/spec/lib/freedom_patches/**/*"
- "**/spec/multisite/**/*"

RSpec/DescribeMethod:
Enabled: true
Expand All @@ -54,12 +54,12 @@ RSpec/DescribedClass:
Enabled: false # To be decided

RSpec/DescribedClassModuleWrapping:
Enabled: false # To be decided
Enabled: true

RSpec/EmptyExampleGroup:
Enabled: true
Exclude:
- 'spec/requests/api/*'
- "spec/requests/api/*"

RSpec/EmptyLineAfterExample:
Enabled: false # TODO
Expand Down Expand Up @@ -92,7 +92,7 @@ RSpec/ExpectChange:
Enabled: false # To be decided

RSpec/ExpectInHook:
Enabled: false # To be decided
Enabled: false

RSpec/ExpectOutput:
Enabled: true
Expand All @@ -101,7 +101,7 @@ RSpec/SpecFilePathFormat:
Enabled: false # To be decided

RSpec/SpecFilePathSuffix:
Enabled: false # To be decided
Enabled: true

RSpec/Focus:
Enabled: true
Expand Down Expand Up @@ -154,9 +154,15 @@ RSpec/MessageSpies:
RSpec/MissingExampleGroupArgument:
Enabled: true

RSpec/MultipleExpectations:
Enabled: false

RSpec/MultipleDescribes:
Enabled: false # TODO

RSpec/MultipleMemoizedHelpers:
Enabled: false

RSpec/MultipleSubjects:
Enabled: true

Expand All @@ -176,7 +182,7 @@ RSpec/ReceiveNever:
Enabled: true

RSpec/RepeatedDescription:
Enabled: false # TODO
Enabled: false

RSpec/RepeatedExample:
Enabled: false # TODO
Expand All @@ -185,7 +191,7 @@ RSpec/RepeatedExampleGroupBody:
Enabled: false # TODO

RSpec/RepeatedExampleGroupDescription:
Enabled: false # TODO
Enabled: false

RSpec/ReturnFromStub:
Enabled: true
Expand Down Expand Up @@ -223,6 +229,9 @@ Capybara/CurrentPathExpectation:
RSpec/Capybara/FeatureMethods:
Enabled: true

Capybara/VisibilityMatcher:
Enabled: true

FactoryBot/AttributeDefinedStatically:
Enabled: true

Expand Down

0 comments on commit 8b5bf28

Please sign in to comment.