-
Notifications
You must be signed in to change notification settings - Fork 9
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
Is smol callable via CLI ? #27
Comments
Hi! For use as a linter, I see a few of blockers that may make this library limited, mostly:
I do want to address these at some point, however there are a handful of unanswered questions about the internal design to preserve performance, simplicity of plain JS objects, and flexibility, so I don't really know when I'll get around addressing these (or how) 😅 |
@cyyynthia Thanks for your reply :) We're looking for a TOML linter, not a formatter for now (it seems there is a prettier-toml anyway), so the linting capability would be enough :) Would you eventually interested that someone makes a PR to CLI-ify your tool ? ( don't know who and where, just asking ^^ ) It shouldn't be that complicated using cosmiconfig :) |
Well, this library is purely a parser/serializer and I can see the added value of a CLI tool, but I am quite happy about the library being zero-dependency which makes it very lightweight to install and use Checking if a file has errors is really trivial (just a call to parse in a try/catch), so I'm not sure if it's worth having it here. Projects wanting to use it via CLI can most likely afford using a wrapper file, use Just shebang recipes, or |
FYI this is what I mean by using $ node -e "try{require('smol-toml').parse('[a.x]\nz=')}catch(e){console.log(e.message);process.exit(0)}"
Invalid TOML document: incomplete key-value declaration: no value specified
1: [a.x]
2: z=
^ Which could be implemented as a very barebones "CLI" that uses a naive arg parser:
|
We are looking for a TOML linter to integrate within MegaLinter, and smol is a serious candidate :)
I don't see in the documentation a way to call it via CLI... is there one ?
If not, would it be considered adding one ?
Many thanks for your responses :)
The text was updated successfully, but these errors were encountered: