Skip to content
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

pre-commit: yamlfmt #12

Open
kou opened this issue Nov 25, 2024 · 9 comments
Open

pre-commit: yamlfmt #12

kou opened this issue Nov 25, 2024 · 9 comments

Comments

@kou
Copy link
Member

kou commented Nov 25, 2024

See also: https://github.com/apache/arrow-go/blob/e112ad0de5ca66133256f2db71bda4dd2d1731f5/.pre-commit-config.yaml#L58-L61

@lidavidm
Copy link
Member

I tried yamlfmt, but it wants to un-wrap long strings which I think is a net negative for us, and retain_line_breaks doesn't seem to do anything

@kou
Copy link
Member Author

kou commented Nov 28, 2024

Oh, could you share a sample format result?

@lidavidm
Copy link
Member

diff --git a/.github/ISSUE_TEMPLATE/usage_question.yaml b/.github/ISSUE_TEMPLATE/usage_question.yaml
index f8e0a7bc..c69d3141 100644
--- a/.github/ISSUE_TEMPLATE/usage_question.yaml
+++ b/.github/ISSUE_TEMPLATE/usage_question.yaml
@@ -23,30 +23,11 @@ body:
   - type: markdown
     attributes:
       value: >
-        While we enable issues as a mechanism for new contributors and passers-by who 
-        are unfamiliar with Apache Software Foundation projects to ask questions and 
-        interact with the project, we encourage users to ask such questions on public 
-        mailing lists:
-        
-        * Development discussions: [email protected] (first subscribe by sending an 
-        e-mail to [email protected]).
-        
-        * User discussions: [email protected] (first subscribe by sending an e-mail 
-        to [email protected]).
-        
-        * Mailing list archives: https://arrow.apache.org/community/
-        
-        
-        Do not be surprised by responses to issues raised here directing you to those 
-        mailing lists, or to report a bug or feature request here.
-
-
-        Thank you!
+        While we enable issues as a mechanism for new contributors and passers-by who  are unfamiliar with Apache Software Foundation projects to ask questions and  interact with the project, we encourage users to ask such questions on public  mailing lists: #magic___^_^___line * Development discussions: [email protected] (first subscribe by sending an  e-mail to [email protected]). #magic___^_^___line * User discussions: [email protected] (first subscribe by sending an e-mail  to [email protected]). #magic___^_^___line * Mailing list archives: https://arrow.apache.org/community/ #magic___^_^___line #magic___^_^___line Do not be surprised by responses to issues raised here directing you to those  mailing lists, or to report a bug or feature request here. #magic___^_^___line #magic___^_^___line Thank you!
   - type: textarea
     id: description
     attributes:
-      label: > 
-        Describe the usage question you have. Please include as many useful details as 
-        possible.
+      label: >
+        Describe the usage question you have. Please include as many useful details as  possible.
     validations:
       required: true

@lidavidm
Copy link
Member

diff --git a/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml b/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml
index c4f00170..c370337d 100644
--- a/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml
+++ b/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml
@@ -11,113 +11,52 @@
 
 name: 'test1_all_datatypes_h2'
 
-create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT,
-    decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP,
-    binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT,
-    null_field18 NULL, list_field19 INT ARRAY, map_field20 VARCHAR(256));'
+create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT, decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP, binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT, null_field18 NULL, list_field19 INT ARRAY, map_field20 VARCHAR(256));'

(and many more changes like this)

@lidavidm
Copy link
Member

I also tried setting the config to only touch .pre-commit-config.yaml but it seems that doesn't take effect (or I didn't set it up right)

@kou
Copy link
Member Author

kou commented Nov 28, 2024

Oh... They are unexpected results...

@kiszk
Copy link
Member

kiszk commented Dec 4, 2024

Oh, I overlooked this discussion. I unwrapped long strings...

@kiszk
Copy link
Member

kiszk commented Dec 4, 2024

I also confirmed that retain_line_breaks=true doesn't seem to do anything.

yamlfmt -dry -formatter retain_line_breaks=true ...

@kiszk
Copy link
Member

kiszk commented Dec 12, 2024

I have no idea to resolve this format issue. For now, let me postpone this issue later.

kiszk added a commit to kiszk/arrow-java that referenced this issue Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants