-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: pre-commit hook with no prerequisites #371
feat: pre-commit hook with no prerequisites #371
Conversation
That was quick! Does it work for you though? I'm getting an error message:
Is it possible that the alejandra Cargo.toml doesn't have enough information for pre-commit to install it? |
I trust your judgment, since you use pre-commit you have a better idea about what works best I think the error you get is because Alejandra uses cargo workspaces
|
Doesn't look like we can pass arguments to Cargo (I imagine it would be a huge security issue target). Some options:
What do you think? |
This one may be possible, but there is some setup effort to it (moving files around, updating CI, and so on). Right now we have 2 crates (Alejandra, alejandra_cli) so we can use the Alejandra crate both in the CLI and in the Demo Website, as long as we maintain this property, I think I would be fine with reorganizing the project layout But before that:
Just trying to see if there is a simpler approach than moving the whole repo around |
I don't think so. Those are the arguments sent to the hook, not to the build process.
I'm not sure; this is too much into the details of Rust/pre-commit for my knowledge. If
I don't know. Looking through the options:
|
Cooking a container image and publishing it to a registry should be very easy, would this be a solution to what you try to accomplish? what would be the advantages of this vs using a pre-compiled binary from the releases page? https://github.com/kamadorueda/alejandra/releases , both would be more or less "downloading a binary and running it" I mention the language:script because same as the language:rust runs cargo under the hood, we can just make the script do that, store a cache somewhere, and so on so that it doesn't compile things every time |
Pre-compiled would probably be best, since it wouldn't require Docker and would be faster because of no building. |
feel free to go with the one that works best for you. If it works well for you, it'll probably be most useful for other users, too |
In the meantime, feel free to revert this if it's going to block any releases. Also, thank you for your patience! |
@kamadorueda Are you OK with the new no-prerequisites hook replacing the hook which requires Nix? Otherwise I could just rename it.
Closes #370.