Skip to content

Commit

Permalink
Issue voting (#75)
Browse files Browse the repository at this point in the history
* add new cops
Co-authored-by: Tristan van Grieken <[email protected]>
Co-authored-by: Shannon Fuit <[email protected]>
  • Loading branch information
Braitenberg authored Aug 17, 2020
1 parent 81ae977 commit f6122b1
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 12 deletions.
33 changes: 33 additions & 0 deletions .rubocop-performance.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
require: rubocop-performance

Performance/AncestorsInclude:
Enabled: true

Performance/StringInclude:
Enabled: true

Performance/ChainArrayAllocation:
Enabled: true

Performance/OpenStruct:
Enabled: true

Performance/Squeeze:
Enabled: true

Performance/SortReverse:
Enabled: true

Performance/ReverseFirst:
Enabled: true

Performance/RedundantStringChars:
Enabled: true

Performance/RedundantSortBlock:
Enabled: true

Performance/IoReadlines:
Enabled: true

Performance/DeleteSuffix:
Enabled: true

Performance/BindCall:
Enabled: true

Performance/BigDecimalWithNumericArgument:
Enabled: true
51 changes: 51 additions & 0 deletions .rubocop-rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,57 @@ Rails/SafeNavigationWithBlank:
Rails/SkipsModelValidations:
Enabled: false

Rails/UniqueValidationWithoutIndex:
Enabled: true

Rails/RenderPlainText:
Enabled: true

Rails/RenderInline:
Enabled: true

Rails/RedundantForeignKey:
Enabled: true

Rails/PluckInWhere:
Enabled: true

Rails/Pluck:
Enabled: true

Rails/Pick:
Enabled: true

Rails/NegateInclude:
Enabled: true

Rails/MailerName:
Enabled: true

Rails/FindById:
Enabled: true

Rails/ContentTag:
Enabled: true

Rails/MatchRoute:
Enabled: true

Rails/ShortI18n:
Enabled: true

Rails/PluckId:
Enabled: false

Rails/ActiveRecordCallbacksOrder:
Enabled: true

Rails/Inquiry:
Enabled: true

Rails/WhereExists:
Enabled: true

Rails/UnknownEnv:
Environments:
- development
Expand Down
15 changes: 15 additions & 0 deletions .rubocop-rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,18 @@ RSpec/VoidExpect:

RSpec/Yield:
Enabled: true

RSpec/RepeatedExampleGroupDescription:
Enabled: true

RSpec/VariableName:
Enabled: true

RSpec/VariableDefinition:
Enabled: true

RSpec/RepeatedExampleGroupBody:
Enabled: true

RSpec/EmptyHook:
Enabled: true
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ require:
- rubocop-rspec

inherit_from: default.yml

Style/Documentation:
Enabled: false
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,50 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.7.0] - 10 August 2020

- Added Rails/ActiveRecordCallbacksOrder
- Added Rails/Inquiry
- Added Rails/WhereExists

- Added Lint/RaiseException
- Added Lint/MixedRegexpCaptureTypes
- Added Lint/DeprecatedOpenSSLConstant
- Added Lint/DuplicateElsifCondition
- Added Lint/MixedRegexpCaptureTypes

- Added Performance/AncestorsInclude
- Added Performance/StringInclude
- Added Performance/Squeeze
- Added Performance/SortReverse
- Added Performance/ReverseFirst
- Added Performance/RedundantStringChars
- Added Performance/RedundantSortBlock
- Added Performance/IoReadlines
- Added Performance/ReverseFirst
- Added Performance/DeleteSuffix
- Added Performance/BindCall
- Added Performance/BigDecimalWithNumericArgument
- Added Performance/DeleteSuffix

- Added RSpec/RepeatedExampleGroupDescription
- Added RSpec/VariableName
- Added RSpec/VariableDefinition
- Added RSpec/RepeatedExampleGroupBody
- Added RSpec/EmptyHook
- Added RSpec/RepeatedExampleGroupBody

- Added Style/SlicingWithRange
- Added Style/RedundantRegexpEscape
- Added Style/RedundantRegexpCharacterClass
- Added Style/RedundantFetchBlock
- Added Style/RedundantAssignment
- Added Style/HashTransformValues
- Added Style/HashEachMethods
- Added Style/ExponentialNotation
- Added Style/BisectedAttrAccessor
- Added Style/AccessorGrouping

## [0.6.1] - 11 March 2020

- Bumped rake dependency to a higher version to mitigate CVE-2020-8130
Expand Down
80 changes: 76 additions & 4 deletions default.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
inherit_from: .rubocop-performance.yml

AllCops:
TargetRubyVersion: 2.3
TargetRubyVersion: 2.6
Exclude:
- db/migrate/*
- db/seeds/*
Expand Down Expand Up @@ -90,6 +90,12 @@ Style/EachWithObject:
Style/UnpackFirst:
Enabled: false

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true

Layout/SpaceAroundMethodCallOperator:
Enabled: true

Layout/EndAlignment:
EnforcedStyleAlignWith: variable

Expand All @@ -100,6 +106,9 @@ Layout/FirstParameterIndentation:
Enabled: true
EnforcedStyle: consistent

Layout/LineLength:
Max: 120

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Expand All @@ -112,9 +121,6 @@ Style/TrivialAccessors:
Metrics/AbcSize:
Enabled: false

Metrics/LineLength:
Max: 120

Metrics/BlockLength:
CountComments: false # count full line comments?
Max: 50
Expand Down Expand Up @@ -165,6 +171,54 @@ Style/NegatedUnless:
Style/StringLiterals:
Enabled: false

Style/ArrayCoercion:
Enabled: true

Style/CaseLikeIf:
Enabled: true

Style/HashAsLastArrayItem:
Enabled: true

Style/HashLikeCase:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

Style/RedundantAssignment:
Enabled: true

Style/RedundantFetchBlock:
Enabled: true

Style/RedundantFileExtensionInRequire:
Enabled: true

Style/RedundantRegexpCharacterClass:
Enabled: true

Style/RedundantRegexpEscape:
Enabled: true

Style/SlicingWithRange:
Enabled: true

Style/HashEachMethods:
Enabled: true

Style/ExponentialNotation:
Enabled: true

Style/BisectedAttrAccessor:
Enabled: true

Style/AccessorGrouping:
Enabled: true

Style/StringLiteralsInInterpolation:
Enabled: false

Expand All @@ -185,3 +239,21 @@ Lint/ToJSON:

Gemspec/RubyVersionGlobalsUsage:
Enabled: true

Lint/NonDeterministicRequireOrder:
Enabled: false

Lint/RaiseException:
Enabled: true

Lint/MixedRegexpCaptureTypes:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true

Lint/StructNewOverride:
Enabled: true

Lint/DuplicateElsifCondition:
Enabled: true
2 changes: 1 addition & 1 deletion lib/rubocopital/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Rubocopital
VERSION = "0.6.1"
VERSION = "0.7.0"
end
8 changes: 4 additions & 4 deletions rubocopital.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_runtime_dependency "rubocop", "~> 0.77.0"
spec.add_runtime_dependency "rubocop-performance", "~> 1.5.1"
spec.add_runtime_dependency "rubocop-rails", "2.4.0"
spec.add_runtime_dependency "rubocop-rspec", "1.37.0"
spec.add_runtime_dependency "rubocop", "~> 0.88.0"
spec.add_runtime_dependency "rubocop-performance", "~> 1.7.1"
spec.add_runtime_dependency "rubocop-rails", "2.7.0"
spec.add_runtime_dependency "rubocop-rspec", "1.42.0"

spec.add_development_dependency "bundler"
spec.add_development_dependency "rake", ">= 12.3.3"
Expand Down

0 comments on commit f6122b1

Please sign in to comment.