Trim trailing whitespace and ensure Markdown files are POSIX compliant - #246
Conversation
|
With 659 modified files (including SVG and glTF), there's hardly a way to sensibly review this. I think that differentiating between the commit that changes the script, and one or multiple commits for the modified files, it could be clearer (so what exactly was the change to the PHP file that causes all these changes?) But to start with a question waaaay higher: Where and how is this relevant? |
|
@javagl There are many utilities that expect text files to be POSIX-compliant text files, especially on Mac/Linux systems. For example, As for reviewing, click the "Hide whitespace" check box in the "Files Changed" tab to make reviewing easier:
|
| @@ -504,10 +511,10 @@ public function writeReadme ($tagListings=null) { | |||
| $readme[] = $this->metadata['credit'][$ii]; | |||
| } | |||
| //$readme[] = "#### Assembled by " . AppName . ' ' . AppVersion; | |||
| $readme[] = "#### Assembled by " . AppName; | |||
| $readme[] = "#### Assembled by " . AppName . "\n"; | |||
There was a problem hiding this comment.
There are 3 total lines of the PHP script changed to specifically add the \n, here is one case.
| 'link'=>'', | ||
| 'text'=>'Cesium Trademark or Logo', | ||
| 'spdx'=>'LicenseRef-LegalMark-Cesium', | ||
| ), | ||
| 'LicenseRef-LegalMark-DGG' => array ( |
There was a problem hiding this comment.
I forgot I included these, I put these changes in here because otherwise the license in .reuse/dep5 gets generated as License: CC-BY-4.0 AND LicenseRef-LegalMark-Khronos AND with a trailing space and a trailing AND. But that should probably get another PR to fix this first. EDIT: So let's merge #248 first.
|
I'm aware of the constant background noise of As a baseline, I'm skeptical for a change like this. So there was something in the The main point is that changing 659 files warrants some scrutiny. This is not C++ code, and when it's only about some IDE inserting an extra line, then this sounds like a configuration issue of the IDE, and not something that warrants such a wide-ranging change. ("Removing trailing whitespaces in |
Actually, a pair of trailing spaces in Markdown is often intentional. It was the original official Markdown way of adding a line break, before https://www.markdownguide.org/basic-syntax/#line-break-best-practices I've added some end-of-file fixes in #254. Perhaps this PR can be closed? |
df0e5de to
7422584
Compare
|
For Markdown line breaks, I just opened PR #265, which should be merged ahead of this PR. |
925f864 to
ae2ae44
Compare
ae2ae44 to
e2599f9
Compare
e2599f9 to
ce7b7c5
Compare
ce7b7c5 to
48cdaa8
Compare
javagl
left a comment
There was a problem hiding this comment.
Summarizing some discussion (also from the Tooling TSG call):
There had been some concerns about formatting .gltf and .svg files in a particular way. Every time that a .gltf was updated (or a new one was added), the state would "diverge" again from the current state here.
One thing that would make sense and still can be considered:
We would like to have some human-readable formatting for the .gltf files. People shouldn't submit .gltf files with { everything: { in: { one: line }}} for example. This cannot sensibly be made a requirement for submitting and merging a PR (because we don't have influence on the tools that generate these files). But it could be made part of CI: Whenever a PR is merged, the CI could do some trivial pseudocode of
write(read("file.gltf"), "file.gltf");
to apply consistent formatting to the glTF files.
That said, this PR was now updated to only affect the markdown files, and specifically the body.md files. This is important: These are the files that are contributed externally - in contrast the the actual README.md for each model, which is automatically generated, and only inlines the respective .body.md file.
So this PR brings all the body.md files into a consistent shape. Looking at the changes, it is indeed only
- removing unnecessary trailing spaces
- removing unnecessary newlines
- adding newlines at the end of the files where they are due
So I think that this can be merged.
There had been some inlined comments about the PHP, e.g. at #246 (comment) . Given that the PHP was changed to TypeScript as of #280 , I assume that these comments are obsolete. This involves the (somewhat bold) assumption that the new, TypeScript based tools generate MD that does not have the issues that have been fixed here. But this may have to be confirmed. Which leads to the last point:
There should probably be some CI step for (automated) Markdown formatting. I've opened #290 for tracking this.
|
So I'll just go ahead and merge this. @aaronfranke If you want to address #290 , just drop me a note. Otherwise, I'll try to have a look at this soon (before there are too many additions that "diverge" from the current state) |

This PR updates the PHP scripts to output POSIX-compliant text files, which means text files that end in one\ncharacter.This PR also runs the scriptsand manually goes over files the script did not touch (like sourceI also added an.gltffiles)..editorconfigfile to give a hint to IDEs that they should automatically fix this problem if encountered. This PR also trims trailing whitespace.