Skip to content

Commit

Permalink
add new cops
Browse files Browse the repository at this point in the history
  • Loading branch information
lxxxvi committed Jun 9, 2023
1 parent ce4745d commit a124f6d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
63 changes: 63 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ require:
Gemspec/DeprecatedAttributeAssignment:
Enabled: true

Gemspec/DevelopmentDependencies:
Enabled: true

Gemspec/RequireMFA:
Enabled: true

Expand Down Expand Up @@ -64,6 +67,9 @@ Lint/DuplicateElsifCondition:
Lint/DuplicateMagicComment:
Enabled: true

Lint/DuplicateMatchPattern:
Enabled: true

Lint/DuplicateRegexpCharacterClassElement:
Enabled: true

Expand Down Expand Up @@ -169,12 +175,18 @@ Lint/UnreachableLoop:
Lint/UselessMethodDefinition:
Enabled: true

Lint/UselessRescue:
Enabled: true

Lint/UselessRuby2Keywords:
Enabled: true

Lint/UselessTimes:
Enabled: true

Metrics/CollectionLiteralLength:
Enabled: true

Minitest/AssertInDelta:
Enabled: true

Expand All @@ -196,6 +208,9 @@ Minitest/AssertRaisesCompoundBody:
Minitest/AssertRaisesWithRegexpArgument:
Enabled: true

Minitest/AssertSame:
Enabled: true

Minitest/AssertSilent:
Enabled: true

Expand All @@ -211,13 +226,19 @@ Minitest/DuplicateTestRun:
Minitest/EmptyLineBeforeAssertionMethods:
Enabled: true

Minitest/LifecycleHooksOrder:
Enabled: true

Minitest/LiteralAsActualArgument:
Enabled: true

Minitest/MultipleAssertions:
Enabled: true
Max: 5

Minitest/NonPublicTestMethod:
Enabled: true

Minitest/RefuteInDelta:
Enabled: true

Expand All @@ -230,12 +251,21 @@ Minitest/RefutePathExists:
Minitest/RefutePredicate:
Enabled: true

Minitest/RefuteSame:
Enabled: true

Minitest/ReturnInTestMethod:
Enabled: true

Minitest/SkipEnsure:
Enabled: true

Minitest/SkipWithoutReason:
Enabled: true

Minitest/TestFileName:
Enabled: true

Minitest/TestMethodName:
Enabled: true

Expand All @@ -245,6 +275,9 @@ Minitest/UnreachableAssertion:
Minitest/UnspecifiedException:
Enabled: true

Minitest/UselessAssertion:
Enabled: true

Naming/BlockForwarding:
Enabled: true

Expand Down Expand Up @@ -278,9 +311,18 @@ Style/CollectionCompact:
Style/CombinableLoops:
Enabled: true

Style/ComparableClamp:
Enabled: true

Style/ConcatArrayLiterals:
Enabled: true

Style/DataInheritance:
Enabled: true

Style/DirEmpty:
Enabled: true

Style/DocumentDynamicEvalDefinition:
Enabled: true

Expand All @@ -293,6 +335,9 @@ Style/EndlessMethod:
Style/EnvHome:
Enabled: true

Style/ExactRegexpMatch:
Enabled: true

Style/ExplicitBlockArgument:
Enabled: true

Expand All @@ -302,6 +347,9 @@ Style/ExponentialNotation:
Style/FetchEnvVar:
Enabled: true

Style/FileEmpty:
Enabled: true

Style/FileRead:
Enabled: true

Expand Down Expand Up @@ -392,6 +440,9 @@ Style/QuotedSymbols:
Style/RedundantArgument:
Enabled: true

Style/RedundantArrayConstructor:
Enabled: true

Style/RedundantAssignment:
Enabled: true

Expand All @@ -410,12 +461,24 @@ Style/RedundantFetchBlock:
Style/RedundantFileExtensionInRequire:
Enabled: true

Style/RedundantFilterChain:
Enabled: true

Style/RedundantHeredocDelimiterQuotes:
Enabled: true

Style/RedundantInitialize:
Enabled: true

Style/RedundantLineContinuation:
Enabled: true

Style/RedundantRegexpCharacterClass:
Enabled: true

Style/RedundantRegexpConstructor:
Enabled: true

Style/RedundantRegexpEscape:
Enabled: true

Expand Down
4 changes: 2 additions & 2 deletions test/ruboclean/rubocop_configuration_path_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_invalid_path_error
def test_load_with_file_path
using_fixture_file("00_input.yml") do |fixture_path|
Ruboclean::RubocopConfigurationPath.new(fixture_path).load.tap do |result|
assert_equal Ruboclean::RubocopConfiguration, result.class
assert_instance_of Ruboclean::RubocopConfiguration, result
end
end
end
Expand All @@ -24,7 +24,7 @@ def test_load_with_directory_path
using_fixture_file("00_input.yml") do |fixture_path|
fixture_pathname = Pathname.new(fixture_path)
Ruboclean::RubocopConfigurationPath.new(fixture_pathname.dirname).load.tap do |result| # rubocop:disable Minitest/EmptyLineBeforeAssertionMethods
assert_equal Ruboclean::RubocopConfiguration, result.class
assert_instance_of Ruboclean::RubocopConfiguration, result
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/ruboclean/rubocop_configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_order
output = { "AllCops" => { Enabled: true }, "Rails" => { Enabled: false } }

Ruboclean::RubocopConfiguration.new(input).order.tap do |ordered_output|
assert_equal Hash, ordered_output.class
assert_instance_of Hash, ordered_output
assert_equal output.to_a, ordered_output.to_a
end
end
Expand Down

0 comments on commit a124f6d

Please sign in to comment.