-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Discussion] State of repository and some thoughts on changes #2609
Comments
We could use a tool to format and sort properties in all manifests at once. |
Sure. |
Most of the sublime settings can be superseded by IMO Also I wish there is a point system for quality of the app, so we can promote and demote apps to and from
But that last point might be a bigger undertaking. |
- Lint file a bit - Add synopsis - Add default parameters - Replace shortcutted cmdlets / parameters - Add schema validation for VSCode - Add recommended VSCode extensions - Move everything from scoop-sublime-project into settings.json - Small progress on #2609 and making developers life easier
I can't agree with that. Scoop should be built with ease of use for the end user, not a developer. Yes, it's a pain to capture write-hosts, and prior to PSH 5, impossible. But there are plenty of ways around this. |
Renaming examples:
Already changed:
|
Not sure about yml. Having worked with it last two years, got a lot of problems from developers who find it difficult, to get the indentation right, get string escaping right and distinguish between lists and properties. What are specific problems with json (apart from not being able to write comments?). Toml could be a simpler alternative to yaml, however it does not seem to have adequate tooling for Powershell. |
JSON also doesn't support multi-line strings, so you have to emulate them with arrays. Since you have to quote all strings, you also have to escape any double quotes you're using in strings (which will be common occurrences when writing post-install scripts). When it comes to multi-line strings with YAML, there's a website for it: yaml-multiline.info 🙂 |
YAML is best suitable for manifest creation. You do not quote any string in yaml. Unless it is number, which needs to be string Here is comparison of pretty tough manifest with lots of code inside json and yaml |
Acutally there are some toml libraries for .NET, such as Nett. And I prefer toml too (see, Rust/Cargo is great!), yaml is simpler though. |
You need to be careful with YAML. It certainly looks a lot nicer than JSON, but it's actually a hugely complicated format and a nightmare to parse, so most parsers don't implement the full feature set. Consider the fact that YAML supports comments. At first glance this seems like an advantage, but let's see what would happen if you actually tried to use them in a manifest: description: Example YAML manifest
version: 2.3.1
# really important comment that maintainers absolutely must read!
checkver:
url: https://example.com/download Now let's run autoupdate: description: Example YAML manifest
version: 2.3.2
checkver:
url: https://example.com/download Oh dear, the comment has disappeared! How can we avoid this happening? Like this: description: Example YAML manifest
version: 2.3.1
_comment: really important comment that maintainers absolutely must read!
checkver:
url: https://example.com/download This is exactly how comments in JSON work. The fact that JSON doesn't support proper comments is a feature of the language. The situation with newlines is similar, though not a serious. The problem with comments is not unique to YAML, but it demonstrates that having another feature is not necessarily a good thing (and YAML has a lot of features!). If you want to switch to YAML then you should restrict yourself to using a sensible subset of its features. |
What's autoupdate? While I myself warned against unnescessary complexity that yaml brings, your comment does not see to apply to the scoop use case. Let's take comments. I cannot forsee a scenarion where comments in scoop yaml needs to be re-parsed and put back, this is just does not seem realistic. So based on your evidence there is no point in restricting yourself to using a feature set that excludes comments. And if that's not an issue it's not clear to what subset you recommend to restrict to. In scoop, the intention of using Yaml is to make the manifests easier to work with for humans, while not more difficult to work with for scoop (that is not requiring a huge re-write). The most prominent improvement mentioned, is the use of comments, and use of multi-line values. If you look at it from this perspective it's easy to see why Yaml is appealing. There is no intention to use some especialy complex feature set just for the sake of it, intention is to model the same things that are currently modelled in json, but without the aforementioned problematic facets. I personally think that there are other facets of yaml which may make its use cumbersome, but I already touched in my prior comment. |
It should be possible to add a script that will automatically add these comments back.
Checkver/autoupdate is a tool that bucket admins use to automatically update the manifests. E.g. if go-lang releases a new update, the autoupdate tool will automatically download the release and update the download URL, hash, and version of the manifest. In the process of doing so, some of the fields can be re-arranged and comments will disappear. |
Autoupdate is a tool to ensure manifests always point to the latest version without requiring manual intervention by scoop maintainers. If you look through the bucket history you will see that the vast majority of commits are updating manifests, so autoupdate is central to how scoop operates. Comments, like this one in git's manifest, need to be preserved.
How can you claim that when you don't know what autoupdate is?
I totally agree, but as you said elsewhere, there are no plans to use those features. I was pointing out that even the features that have been explicitly cited as advantages, and given as reasons to switch, have unintended consequences.
You are proposing to create a custom YAML parser that doesn't obey the standard, for no better reason than syntax highlighting. If comments are important then they should be treated as part of the data. This is the point that JSON's inventor made when he deliberately removed comments from the JSON spec. Fundamentally, what is the difference between comments and app descriptions? One is aimed at developers, the other at users, yet both are equally important. We don't comment out |
Ultimately I'm in favour of a switch to YAML, just as long as it is used sensibly. Even if you end up treating YAML like JSON and doing this: description: Example YAML manifest
version: 2.3.1
_comment: really important comment that maintainers absolutely must read!
checkver:
url: https://example.com/download
post_install:
- $doThis
- $doThat
- $doSomethingElse I think we can all agree that is a massive improvement over: {
"description": "Example JSON manifest",
"version": "2.3.1",
"_comment": "really important comment that maintainers absolutely must read!",
"checkver": {
"url": "https://example.com/download"
},
"post_install": [
"$doThis",
"$doThat",
"$doSomethingElse"
]
} The problem with JSON is its unnecessary use of quotes and braces, not its less-is-more philosophy on features. Its just a pity that the YAML developers weren't content with simply sorting out JSON's problems and instead went on to create a bunch of problems that didn't previously exist. |
I'm right back with you. Now it makes total sense. |
As someone who recently discovered Scoop only a few days ago, I really can't comment much about which manifest format is best suited; however I wanted to see whether you've considered Powershell? We're using a project similar to Scoop called Rez where YAML was the de-factor standard for the first few years, until it switched to Python (in which the project is also written). There was the argument, like with any configuration-like format, that using a scripting language gives the author too much power and invites complexity, but in reality what manifests do is complex. I think the issue of multiline is one example of this, and As an example. On the flip-side, parsing a JSON is really straightforward and fast, and importantly doesn't carry side-effects. Something the manifest author would have to take into account if something like TLDR; a complex problem may rightfully require a complex solution |
The advantage of using a serialisation format rather than a scripting language is that it doesn't allow arbitrary code to be executed. I see this as a feature rather than a bug.
|
Hi, I built another documentation site for Scoop. Ideas and suggestions are welcome! |
* add the latest documentation site [Why I build another doc site](ScoopInstaller/Scoop#2609 (comment)) * Update README.md
Hello, I've been using scoop for around a year now and something that I've always wished for was the ability to use |
I really hope Scoop doesn't switch to YAML. JSON is much more sane to parse, and honestly to write. (YAML multiline strings even have their own reference website: https://yaml-multiline.info/.) If you want to change off JSON to something more human-readable, I'd recommend TOML or eno. TOML is probably the better option here, and it has some nice .NET parsing options, including Tommy (MIT), a single-file parser that should be usable via Example
|
Or there's StrictYAML. It keeps the readability of YAML but removes the unsafe and unnecessary features. |
@dillonKneeland I was working on #3446 and this could be added. But I haven't had the time to finish it yet. @bb010g TOML looks really promising. 👍 |
Hey @Ash258 As you have closed this issue/discussion, what is the latest status of the Scoop project? It looks like it is getting less and less maintained. Additionally, I saw that you put a lot of effort into your fork (https://github.com/Ash258/Scoop-Core). Furthermore, why are the remaining parts of Scoop not moved to the https://github.com/ScoopInstaller organization? BR |
I'd think this is the best place to mention. Persons are interested in business support for scoop/shovel. I've seen multiple companies/people pass on scoop due to there being no support available. From the point of 'if something is broken, call/chat/mail support to have it fixed', and not use up a workday fixing things. |
Late to the party. I can see the project is being abandoned. Thank you @dwettstein for pointing that out. |
I would like to add support for placing output in a PSObject instead of writing to stdout. Would such a PR be welcome? |
@sharpninja Yes! Please find the relevant issue (or create one if it doesn't exist), and raise a PR against it :) |
I just finished up a bunch of changes for my PS Snippets and am motivated to work on this again. I had these changes made at one point locally, but I'm not sure if they got lost with my laptop that died. Will look for them. |
No description provided.
The text was updated successfully, but these errors were encountered: