-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Consistent formatting of multiline strings #23958
Consistent formatting of multiline strings #23958
Conversation
Not sure if that is really nicer? But @martint you requested changes like this on on PR so thought i would make sense to just use common formatting every where. |
core/trino-main/src/test/java/io/trino/sql/planner/TestOrderBy.java
Outdated
Show resolved
Hide resolved
@@ -238,31 +238,35 @@ public void testRemoveRedundantTableFunction() | |||
assertPlan("SELECT * FROM TABLE(mock.system.pass_through_function(input => TABLE(SELECT 1, true WHERE false) t(a, b) PRUNE WHEN EMPTY))", | |||
output(values(ImmutableList.of("x", "a", "b")))); | |||
|
|||
assertPlan(""" | |||
assertPlan( | |||
""" |
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.
Indentation seems wrong here and in the ones below, too.
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.
Yeah - but to be honest I am not sure how should it be.
Also no matter what I do automatic reformat in intellij breaks it anyway to:
assertPlan(
"""
SELECT *
FROM TABLE(mock.system.two_table_arguments_function(
input1 => TABLE(SELECT 1, true WHERE false) t1(a, b) PRUNE WHEN EMPTY,
input2 => TABLE(SELECT 2, false) t2(c, d) KEEP WHEN EMPTY))
""",
This PR brings back the discussion about automatic code reformatting. IMO it would be great to have. One less thing to think of - even if not optimal from time to time.
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.
See #21815 (comment)
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.
Yeah - this is a mess.
I really think we should commit on using Intellij formatter and plug it in as a headless verifier in CI pipeline to verify if checked in code matches the formatting
core/trino-main/src/test/java/io/trino/type/TestArrayOperators.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/test/java/io/trino/sql/TestSqlFormatter.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/test/java/io/trino/sql/parser/TestSqlParser.java
Outdated
Show resolved
Hide resolved
It's needed to make the auto-formatter in the IDE not mess things up. |
e1841ec
to
332a755
Compare
testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java
Show resolved
Hide resolved
" (2, 2)," + | ||
" (2, 2)," + | ||
" (3, 3)" + | ||
") t(x, y)", | ||
"VALUES (1.0, 1.0, 4)"); | ||
|
||
assertQuery( | ||
"SELECT corr(DISTINCT x, y), corr(DISTINCT y, x), count(DISTINCT x) FROM " + |
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.
make it a multiline string instead
testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java
Show resolved
Hide resolved
plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveS3AndGlueMetastoreTest.java
Show resolved
Hide resolved
plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveS3AndGlueMetastoreTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotConnectorSmokeTest.java
Show resolved
Hide resolved
...rino-product-tests/src/main/java/io/trino/tests/product/hudi/TestHudiSparkCompatibility.java
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/AbstractTestAggregations.java
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java
Outdated
Show resolved
Hide resolved
332a755
to
49e98d4
Compare
cf3f669
to
40f2840
Compare
@@ -175,6 +176,7 @@ private static String preprocessQueryInternal(Optional<String> catalog, Optional | |||
message = "\n===\n" + message + "\n==="; | |||
} | |||
catch (Exception ignored) { | |||
// ignore |
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.
All these "// ignore" comments are noisy and unnecessary. It is clear from the exception name and the empty body that the exception is being ignored.
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 wanted {}
- but checkStyle complains.
Will do
{
}
3f66eea
to
1ddbc64
Compare
Plus some other formatting improvements
1ddbc64
to
4417f07
Compare
I recently played with the spotless plugin .. its MUCH nicer than checkstyle .. we should migrate to it .. upon request from @losipiuk I added this to the agenda for next maintainer meeting |
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: