-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop XmlData specific selection during string parsing #136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scalastyle (reported by Codacy) found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
import cats.xml.XmlData.* | ||
import cats.xml.codec.Decoder | ||
import cats.xml.utils.{impure, Debug, UnsafeValidator} |
Check warning
Code scanning / Codacy-scalameta-pro (reported by Codacy)
This makes it easy to examine visually, and is simple to automate. Warning
testDataEquality[Seq[String]] | ||
testDataEquality[Array[String]] | ||
|
||
private def testDataEquality[T: Arbitrary](implicit |
Check notice
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Values should have minimum scope to avoid misuses. Note test
@@ -74,3 +69,15 @@ | |||
) | |||
} | |||
} | |||
sealed trait NodeContentInstances { | |||
|
|||
import cats.implicits.catsSyntaxEq |
Check warning
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Putting all imports at the beginning of the package can increase readability. Warning
@@ -191,7 +191,7 @@ | |||
val decoderStr2: Decoder[String] = Decoder.decodeString | |||
|
|||
assertEquals( | |||
obtained = decoderStr1.or(decoderStr2).decode(Xml.ofString("test")), | |||
obtained = decoderStr1.or(decoderStr2).decode(Xml.string("test")), |
Check warning
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Prohibits usage of duplicated string literals. Warning test
@@ -584,7 +584,7 @@ | |||
Decoder.decodeBoolean, | |||
Decoder.decodeString | |||
) | |||
.decode(Xml.ofString("foo")) | |||
.decode(Xml.string("foo")) |
Check warning
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Prohibits usage of duplicated string literals. Warning test
@@ -681,6 +675,8 @@ | |||
} | |||
sealed trait XmlNodeInstances { | |||
|
|||
import cats.implicits.catsSyntaxEq |
Check warning
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Putting all imports at the beginning of the package can increase readability. Warning
@@ -21,7 +21,7 @@ | |||
|
|||
test("XmlPrinter.default.prettyString convert XmlData to string") { | |||
|
|||
val tree: Xml = Xml.ofString("VALUE") | |||
val tree: Xml = Xml.string("VALUE") |
Check warning
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Prohibits usage of duplicated string literals. Warning test
@@ -86,12 +82,14 @@ | |||
} | |||
private[xml] sealed trait XmlAttributeInstances { | |||
|
|||
import cats.implicits.catsSyntaxEq |
Check warning
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Putting all imports at the beginning of the package can increase readability. Warning
case value: Double => double(value) | ||
case value: BigInt => bigInt(value) | ||
case value: BigDecimal => bigDecimal(value) | ||
case value => string(value.toString) |
Check notice
Code scanning / Codacy-scalameta-pro (reported by Codacy)
Prohibit case statement pattern match from being lowercase. Note
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #136 +/- ##
==========================================
+ Coverage 61.07% 65.11% +4.03%
==========================================
Files 47 59 +12
Lines 1896 2680 +784
Branches 27 143 +116
==========================================
+ Hits 1158 1745 +587
- Misses 738 935 +197
☔ View full report in Codecov by Sentry. |
This PR fix BUG #124
Still wondering the implication of this changes