-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
XML Pretty-print should be an editorial concern not enforced during the build #637
base: master
Are you sure you want to change the base?
Conversation
…ial overview. Some of the changes suggested by Pretty-print are not really good. Therefore I think it is better to have the option to run Pretty-print but not to enforce it as part of the build.
|
@duncdrum The problem is the not using the pretty-printing. The problem is automatically using the pretty-printing. |
I don't see how not automating it, will benefit the project, other than making it more difficult to maintain, or decreasing consistency. If the existing formatting settings cause issues with listings, editors are free to adjust these and include that as part of their PR so we can review and discuss the changes properly. It's only when we started doing this as part of the build, that side scrolling to actually see the contents of code-listings became a thing of the past. I m afraid that by disabling it, we're moving backwards. We should enforce a central style that also covers code listings, i don't care how we do it. As long as we do it, your descriptions reads to me that you don't want us to do that; I disagree. |
My position is clear and in line with @duncdrum , auto formatting everything (code, articles, ...) is an important part to a maintainable project. |
Would you be able to present an example that illustrates the necessity to remove this check? |
@line-o Sure. Before this PR run
|
I just did this with b071189
|
To reproduce the issue, simply run:
You then have a bunch of suggestions via the auto-formatting which are unstaged as far as Git is concerned:
And... these suggestions are not great as you can see below in the diff, they introduce a great deal of white-space that is very unnatural: diff --git a/src/main/xar-resources/data/lucene/listings/listing-311.xml b/src/main/xar-resources/data/lucene/listings/listing-311.xml
index 3d1ba57..7f967b1 100644
--- a/src/main/xar-resources/data/lucene/listings/listing-311.xml
+++ b/src/main/xar-resources/data/lucene/listings/listing-311.xml
@@ -1,8 +1,14 @@
<analyzer id="my-custom-analyzer" class="tld.org.CustomAnalyzer">
- <param name="minimumTermLength" type="int" value="2" />
- <param name="punctuationDictionary" type="char[]">
- <value>'</value>
- <value>-</value>
- <value>’</value>
- </param>
+ <param name="minimumTermLength" type="int" value="2"/>
+ <param name="punctuationDictionary" type="char[]">
+ <value>
+ '
+ </value>
+ <value>
+ -
+ </value>
+ <value>
+ ’
+ </value>
+ </param>
</analyzer>
diff --git a/src/main/xar-resources/data/xqsuite/listings/custom-assertion-result.xml b/src/main/xar-resources/data/xqsuite/listings/custom-assertion-result.xml
index f9b5ff2..c59cf9a 100644
--- a/src/main/xar-resources/data/xqsuite/listings/custom-assertion-result.xml
+++ b/src/main/xar-resources/data/xqsuite/listings/custom-assertion-result.xml
@@ -1,18 +1,23 @@
<testsuites>
- <testsuite package="http://exist-db.org/xquery/test/xqsuite" timestamp="2022-04-12T14:24:15.72+02:00"
- tests="4" failures="3" errors="0" pending="0" time="PT0.008S">
- <testcase name="test-missing-key" class="t:test-missing-key">
- <failure message="Key 'b' is missing" type="map-assertion"/>
- <output>map{"a":1,"c":4}</output>
- </testcase>
- <testcase name="test-passing" class="t:test-passing"/>
- <testcase name="test-wrong-type" class="t:test-wrong-type">
- <failure message="Type mismatch" type="map-assertion"/>
- <output>[1,2]</output>
- </testcase>
- <testcase name="test-wrong-value" class="t:test-wrong-value">
- <failure message="Value mismatch for key 'b'" type="map-assertion"/>
- <output>map{"a":1,"b":3}</output>
- </testcase>
- </testsuite>
+ <testsuite package="http://exist-db.org/xquery/test/xqsuite" timestamp="2022-04-12T14:24:15.72+02:00" tests="4" failures="3" errors="0" pending="0" time="PT0.008S">
+ <testcase name="test-missing-key" class="t:test-missing-key">
+ <failure message="Key 'b' is missing" type="map-assertion"/>
+ <output>
+ map{"a":1,"c":4}
+ </output>
+ </testcase>
+ <testcase name="test-passing" class="t:test-passing"/>
+ <testcase name="test-wrong-type" class="t:test-wrong-type">
+ <failure message="Type mismatch" type="map-assertion"/>
+ <output>
+ [1,2]
+ </output>
+ </testcase>
+ <testcase name="test-wrong-value" class="t:test-wrong-value">
+ <failure message="Value mismatch for key 'b'" type="map-assertion"/>
+ <output>
+ map{"a":1,"b":3}
+ </output>
+ </testcase>
+ </testsuite>
</testsuites> |
I saw this myself today when running the tests described in the README before I updated #784. |
@joewiz I think you also reported the same problem (as we have both seen) in a previous issue here too - #742 (comment) |
@adamretter Indeed!! |
Some of the changes suggested by Pretty-print are not very good.
Therefore I think it is better to have the option to run Pretty-print, but not to enforce it as part of the build. It was previously only enforced on code-listing and not articles, however the suggestions it was making for the code-listings would actually made their formatting worse; therefore it is best to leave it to the discretion of the Editor.