-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified ArraysEqual and ComparingFloatingPointTypes names
- Loading branch information
Showing
6 changed files
with
76 additions
and
76 deletions.
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
input/src/main/scala/fix/ArraysEquals.scala → input/src/main/scala/fix/ArrayEquals.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
input/src/main/scala/fix/ComparingFloatingPointTypes.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
rule = ComparingFloatingPointTypes | ||
*/ | ||
package fix | ||
|
||
object ComparingFloatingPointTypes { | ||
def test(): Unit = { | ||
val f1 = 1.46456f | ||
val f2 = 1.46456f | ||
if (f1 == f2) { // assert: ComparingFloatingPointTypes | ||
print("Equal!") | ||
} else { | ||
print("Not equal") | ||
} | ||
val d1 = 1.546456 | ||
val d2 = 1.546456 | ||
if (d1 == d2) { // assert: ComparingFloatingPointTypes | ||
print("Equal!") | ||
} else { | ||
print("Not equal!") | ||
} | ||
f1 == d1 // assert: ComparingFloatingPointTypes | ||
f1.equals(f2) // assert: ComparingFloatingPointTypes | ||
d1.equals(d2) // assert: ComparingFloatingPointTypes | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
78 changes: 39 additions & 39 deletions
78
rules/src/main/resources/META-INF/services/scalafix.v1.Rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,70 @@ | ||
fix.ArrayEquals | ||
fix.ArraysInFormat | ||
fix.CatchNpe | ||
fix.ComparingFloatingTypes | ||
fix.EmptyInterpolatedString | ||
fix.ImpossibleOptionSizeCondition | ||
fix.IllegalFormatString | ||
fix.IncorrectNumberOfArgsToFormat | ||
fix.IncorrectlyNamedExceptions | ||
fix.LonelySealedTrait | ||
fix.MapGetAndGetOrElse | ||
fix.NanComparison | ||
fix.OptionGet | ||
fix.OptionSize | ||
fix.StripMarginOnRegex | ||
fix.TryGet | ||
fix.UnsafeTraversableMethods | ||
fix.UnsafeContains | ||
fix.UnsafeStringContains | ||
fix.ArraysToString | ||
fix.AsInstanceOf | ||
fix.AvoidSizeEqualsZero | ||
fix.AvoidSizeNotEqualsZero | ||
fix.AvoidToMinusOne | ||
fix.BigDecimalDoubleConstructor | ||
fix.BigDecimalScaleWithoutRoundingMode | ||
fix.BooleanParameter | ||
fix.BoundedByFinalType | ||
fix.BrokenOddness | ||
fix.CatchException | ||
fix.CatchExceptionImmediatelyRethrown | ||
fix.CatchFatal | ||
fix.CatchNpe | ||
fix.CatchThrowable | ||
fix.ClassNames | ||
fix.CollectionIndexOnNonIndexedSeq | ||
fix.CollectionNamingConfusion | ||
fix.CollectionNegativeIndex | ||
fix.CollectionPromotionToAny | ||
fix.ComparingFloatingPointTypes | ||
fix.ComparisonToEmptyList | ||
fix.ComparisonToEmptySet | ||
fix.ComparisonWithSelf | ||
fix.ConstantIf | ||
fix.DivideByOne | ||
fix.DoubleNegation | ||
fix.DuplicateImport | ||
fix.DuplicateMapKey | ||
fix.DuplicateSetValue | ||
fix.EitherGet | ||
fix.EmptyCaseClass | ||
fix.EmptyFor | ||
fix.EmptyIfBlock | ||
fix.EmptyInterpolatedString | ||
fix.EmptyMethod | ||
fix.EmptySynchronizedBlock | ||
fix.EmptyTryBlock | ||
fix.EmptyWhileBlock | ||
fix.FinalizerWithoutSuper | ||
fix.IllegalFormatString | ||
fix.ImpossibleOptionSizeCondition | ||
fix.IncorrectNumberOfArgsToFormat | ||
fix.IncorrectlyNamedExceptions | ||
fix.InterpolationToString | ||
fix.LonelySealedTrait | ||
fix.LooksLikeInterpolatedString | ||
fix.MapGetAndGetOrElse | ||
fix.MethodReturningAny | ||
fix.NanComparison | ||
fix.NullAssignment | ||
fix.NullParameter | ||
fix.OptionGet | ||
fix.OptionSize | ||
fix.RepeatedCaseBody | ||
fix.RepeatedIfElseBody | ||
fix.StripMarginOnRegex | ||
fix.SwallowedException | ||
fix.TryGet | ||
fix.UnnecessaryConversion | ||
fix.UnreachableCatch | ||
fix.UnsafeContains | ||
fix.UnsafeStringContains | ||
fix.UnsafeTraversableMethods | ||
fix.UnusedMethodParameter | ||
fix.VarCouldBeVal | ||
fix.VariableShadowing | ||
fix.WhileTrue | ||
fix.InterpolationToString | ||
fix.EitherGet | ||
fix.NullParameter | ||
fix.ArraysEquals | ||
fix.ArraysToString | ||
fix.AsInstanceOf | ||
fix.AvoidToMinusOne | ||
fix.BigDecimalDoubleConstructor | ||
fix.BigDecimalScaleWithoutRoundingMode | ||
fix.BooleanParameter | ||
fix.BoundedByFinalType | ||
fix.BrokenOddness | ||
fix.ClassNames | ||
fix.CollectionNamingConfusion | ||
fix.ComparisonToEmptyList | ||
fix.ComparisonToEmptySet | ||
fix.DivideByOne | ||
fix.DoubleNegation | ||
fix.DuplicateMapKey | ||
fix.DuplicateSetValue | ||
fix.EmptyCaseClass | ||
fix.WhileTrue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters