-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
dprint-plugins: init #369415
dprint-plugins: init #369415
Conversation
d5b5f56
to
bf1665b
Compare
df2add1
to
b96de3e
Compare
dprint requires the
|
b96de3e
to
42dfefa
Compare
This comment was marked as outdated.
This comment was marked as outdated.
In my understanding, dprint and the plugins have WASM schema versions. If there is a mismatch between them, dprint CLI does not run the plugin. As far as I know, it occurs when Use https://github.com/dprint/dprint/releases/download/0.46.3/dprint-x86_64-unknown-linux-gnu.zip With dprint.json as below
Then
As far as I know, the latest dprint CLI version 0.48.0 supports old schema versions. However, I think it is not a guaranteed specification. How to keep the compatibilityA version is listed at https://github.com/dprint/plugins/blob/cc8cd4c35bb0685b0a599b8d3c30923e8f41b0a0/info.json#L2-L3, but it does not mean the JSON result always points correct schema versions. So I suggest it. Adding a test that includes all packaged plugins in the |
Or would injecting the dprint CLI package for each plugin package's |
e1048df
to
66004d1
Compare
bff840d
to
88475cf
Compare
@kachick I will look into adding compatibility tests once the code generation part is finalised |
88475cf
to
2d40ed4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @phanirithvij , great work.
I would suggest leaving the schema compatibility issue for later, if it becomes a problem. We should also be mindful of not extending the scope of the PR too much. But up to you @phanirithvij .
Agreed, I will do that in a follow-up PR when I find the time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work 👍
I don't have enough knowledge to review these Python code and usecase in treefmt-nix. However this discussion sounds good to me. 🙇
nixpkgs-review
result
Generated using nixpkgs-review
.
Command: nixpkgs-review pr 369415
x86_64-linux
✅ 12 packages built:
- dprint-plugins.dprint-plugin-biome
- dprint-plugins.dprint-plugin-dockerfile
- dprint-plugins.dprint-plugin-json
- dprint-plugins.dprint-plugin-jupyter
- dprint-plugins.dprint-plugin-markdown
- dprint-plugins.dprint-plugin-ruff
- dprint-plugins.dprint-plugin-toml
- dprint-plugins.dprint-plugin-typescript
- dprint-plugins.g-plane-malva
- dprint-plugins.g-plane-markup_fmt
- dprint-plugins.g-plane-pretty_graphql
- dprint-plugins.g-plane-pretty_yaml
x86_64-darwin
✅ 12 packages built:
- dprint-plugins.dprint-plugin-biome
- dprint-plugins.dprint-plugin-dockerfile
- dprint-plugins.dprint-plugin-json
- dprint-plugins.dprint-plugin-jupyter
- dprint-plugins.dprint-plugin-markdown
- dprint-plugins.dprint-plugin-ruff
- dprint-plugins.dprint-plugin-toml
- dprint-plugins.dprint-plugin-typescript
- dprint-plugins.g-plane-malva
- dprint-plugins.g-plane-markup_fmt
- dprint-plugins.g-plane-pretty_graphql
- dprint-plugins.g-plane-pretty_yaml
aarch64-darwin
✅ 12 packages built:
- dprint-plugins.dprint-plugin-biome
- dprint-plugins.dprint-plugin-dockerfile
- dprint-plugins.dprint-plugin-json
- dprint-plugins.dprint-plugin-jupyter
- dprint-plugins.dprint-plugin-markdown
- dprint-plugins.dprint-plugin-ruff
- dprint-plugins.dprint-plugin-toml
- dprint-plugins.dprint-plugin-typescript
- dprint-plugins.g-plane-malva
- dprint-plugins.g-plane-markup_fmt
- dprint-plugins.g-plane-pretty_graphql
- dprint-plugins.g-plane-pretty_yaml
fetchurl { | ||
inherit hash url; | ||
name = "${pname}-${version}.wasm"; | ||
meta.description = description; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to set license for each plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
as of now, all the official plugin repos have mit license (even g-plane/*), so I added it as a default argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, ideally won't we need to build the wasm binaries from source?
not for this pr, just saying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, ideally won't we need to build the wasm binaries from source?
Initially, I had the same question. However, as far as I know, at least for security reasons, the dprint CLI restricts behaviors for wasm plugins. This is a point that I prefer when selecting dprint WASM plugins for formatting.
as of now, all the official plugin repos have mit license (even g-plane/*), so I added it as a default argument.
Sure. Bye the way, dprint project respects plugins license. I agree for that plugins may depend on the upstream crate license.
dprint license
https://github.com/dprint/dprint/blob/14eb074e9baf8d0533f04ad954e17a5a375e6385/docs/wasm-plugin-development.md?plain=1#L142
And I know a third-party plugin which choose another license of MIT https://github.com/RubixDev/dprint-plugin-stylua/blob/017360e78861dbef4d5c14087660525f9adc9f1a/LICENSE
Co-Authored-By: Jonas Chevalier <[email protected]> Signed-off-by: phanirithvij <[email protected]>
2d40ed4
to
c772c53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for update!
The plan is to keep track of official dprint plugins here, utilising nixpkgs' update infra. see numtide/treefmt-nix#278 (comment)
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)cc: @zimbatm @kachick