jedieaston / Add-ARPEntries

A script to generate AppsAndFeaturesEntries for winget!
MIT License
3 stars 2 forks source link

Add-ARPEntries removes debug information and adds/removes blank lines #13

Open russellbanks opened 2 years ago

russellbanks commented 2 years ago

Running Add-ARPEntries on a manifest removes the debug information, the spacing between the debug information and the manifest data, and adds an extra line at the end of the manifest, all of which are unnecessary to do:

GitHubDesktop_zI3zmKnHWk

  1. The debug information can be important to preserve (or even add to). It's been important recently to know what tools were creating manifests with LF line endings compared to CRLF line endings.
  2. The space between the comments and the manifest data seperates the two.
  3. There is already a new line at the end of the file so it doesn't make sense to have two.
jedieaston commented 2 years ago

I can fix the newline bug, but the comments can't be preserved without rolling my own YAML parser (powershell-yaml doesn't keep them) or moving to a different language with a better parser (more likely, I've been playing around with moving this stuff to Python). I can maybe make a special fix to preserve the first comment line, and if it isn't related to the language server, then put it in the outputted file(s).

It's been important recently to know what tools were creating manifests with LF line endings compared to CRLF line endings.

OT, but is there a reason we need to know what tool did this? There's two major tools, YamlCreate and wingetcreate, and wingetcreate is the only one that screws up line endings (and even then, only when you use --submit.). I think "line endings screwed up, plz fix" is a valid review comment and the user can manually fix them (at least, until we put the .gitattributes file back).

vedantmgoyal9 commented 1 year ago

@russellbanks you can run .\YamlCreate.ps1 -AutoUpgrade over manifests after AppsAndFeaturesEntries has been added. This will also move same installer keys at root level, and add unused fields as comments.

Make sure to enable developer options as listed here: https://github.com/microsoft/winget-pkgs/blob/master/doc/tools/YamlCreate.md