-
Notifications
You must be signed in to change notification settings - Fork 73
Update scalafmt-core to 3.8.6 #1413
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -631,8 +631,7 @@ trait ElementBase | |
// if they have binary representation we must worry about packed digits, which require 4-bit alignment. | ||
// | ||
primType match { | ||
case PrimType.Float | PrimType.Double | PrimType.Boolean | | ||
PrimType.HexBinary => /* Non textual data, no need to compare alignment to encoding's expected alignment */ | ||
case PrimType.Float | PrimType.Double | PrimType.Boolean | PrimType.HexBinary => /* Non textual data, no need to compare alignment to encoding's expected alignment */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one got compressed onto a single line. |
||
case _ => | ||
binaryNumberRep match { | ||
case BinaryNumberRep.Packed | BinaryNumberRep.Bcd | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,19 +338,24 @@ class TestDFDLExpressionTree extends Parsers { | |
@Test def test_numbers() = { | ||
|
||
testExpr(dummySchema, "{ 5.0E2 }") { | ||
case WholeExpression(_, LiteralExpression(500.0), _, _, _, _) => /* ok */ ; | ||
case WholeExpression(_, LiteralExpression(500.0), _, _, _, _) => /* ok */ | ||
; | ||
Comment on lines
-341
to
+342
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really a fan of these changes, is it worth configuring this (if possible)? |
||
} | ||
testExpr(dummySchema, "{ 5E2 }") { | ||
case WholeExpression(_, LiteralExpression(500.0), _, _, _, _) => /* ok */ ; | ||
case WholeExpression(_, LiteralExpression(500.0), _, _, _, _) => /* ok */ | ||
; | ||
} | ||
testExpr(dummySchema, "{ .2E2 }") { | ||
case WholeExpression(_, LiteralExpression(20.0), _, _, _, _) => /* ok */ ; | ||
case WholeExpression(_, LiteralExpression(20.0), _, _, _, _) => /* ok */ | ||
; | ||
} | ||
testExpr(dummySchema, "{ .2E-3 }") { | ||
case WholeExpression(_, LiteralExpression(0.0002), _, _, _, _) => /* ok */ ; | ||
case WholeExpression(_, LiteralExpression(0.0002), _, _, _, _) => /* ok */ | ||
; | ||
} | ||
testExpr(dummySchema, "{ .2E+3 }") { | ||
case WholeExpression(_, LiteralExpression(200.0), _, _, _, _) => /* ok */ ; | ||
case WholeExpression(_, LiteralExpression(200.0), _, _, _, _) => /* ok */ | ||
; | ||
} | ||
|
||
// testExpr(dummySchema, "0.") { actual => | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,7 +249,9 @@ class TestUnicodeErrorTolerance { | |
) | ||
val input = new ByteArrayInputStream(inBuf); | ||
val e = | ||
intercept[MalformedInputException] { // fails to convert because there is no possible surrogate-pair rep for this. | ||
intercept[ | ||
MalformedInputException | ||
] { // fails to convert because there is no possible surrogate-pair rep for this. | ||
Comment on lines
-252
to
+254
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just harder to read in my opinion |
||
Converter.parse(input, decoder) | ||
} | ||
assertEquals(1, e.getInputLength()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -342,7 +342,9 @@ class TestTDMLRunner { | |
fileWriter.write(testSchema.toString()) | ||
} | ||
|
||
val testSuite = <testSuite xmlns={tdml} suiteName="theSuiteName"> | ||
val testSuite = <testSuite xmlns={ | ||
tdml | ||
} suiteName="theSuiteName"> | ||
Comment on lines
-345
to
+347
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also seems harder to read. |
||
<parserTestCase name="testRunTDMLFileReferencingModelFile" root="data" model={ | ||
tmpSchemaFile.toURI.toString | ||
}> | ||
|
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.
Curious why some lines get expanded like this and others get compressed onto a single line.
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.
I can't really say. I imagine this has to do with long lines and splitting function parameters per line.
We really shouldn't disable scalafmt, so if we don't like these changes, we either need to find and modify a config option that changes it (not sure what that would be or if it would affect other places), open a bug with scalafmt if we think it's wrong, or rewrite it in some way that doesn't require this formatting. Of those, the last is probably the best option, but I'm not sure how much it's wroth it.
I generally let scalafmt do its thing for existing code and just focus on ensuring new code is formatted reasonably.
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.
I took a little look into changing some settings and I think adding
newlines.avoidForSimpleOverflow = [slc]
helps a bit as that will ignore trailing single line comments when determining if we should create a new line. Tried adjusting some settings for XML literals too, but that just made things worse. You can see what the changes would look like here:
main...jadams-tresys:incubator-daffodil:scalafmt
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.
The avoidForSimpleOverflow=[slc] is definitely a reasonable improvement. Loosening line length restrictions in favor a readability is usually a win. That said, in most of the changes I would think just moving the comment to its own line is probably more readable, but I'm not sure it's worth the effort to fix.