Skip to content
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

Replace pre-commit with prefligit #44995

Open
potiuk opened this issue Dec 17, 2024 · 3 comments
Open

Replace pre-commit with prefligit #44995

potiuk opened this issue Dec 17, 2024 · 3 comments
Labels
area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code

Comments

@potiuk
Copy link
Member

potiuk commented Dec 17, 2024

As @ashb noticed there is a new drop-in replacement for pre-commit in town written in rust - with presumably less opinionated choices (and nicer features) than pre-commit. It's not "ready yet" - it does not have everything implemented yet, but looks promising.

https://github.com/j178/prefligit

We might want to take a look at figure out what is missing and replace pre-commit with it when we think it's ready

@potiuk potiuk converted this from a draft issue Dec 17, 2024
@dosubot dosubot bot added the area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code label Dec 17, 2024
@potiuk potiuk changed the title Replace pre-commit with preflight Replace pre-commit with prefligit Dec 17, 2024
@potiuk
Copy link
Member Author

potiuk commented Dec 17, 2024

Current status - it fails wit:

[jarek:~/code/airflow] main+ 101 ± RUST_BACKTRACE=1 prefligit run   
⠙ Initializing hooks...                                                                                                                                                                                                                                                                                                                                                                       thread 'main' panicked at src/languages/mod.rs:47:18:
not yet implemented
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: prefligit::hook::HookBuilder::combine
   4: prefligit::hook::Project::init_hooks::{{closure}}
   5: prefligit::cli::run::run::run::{{closure}}
   6: prefligit::run::{{closure}}
   7: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
   8: tokio::runtime::runtime::Runtime::block_on
   9: prefligit::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[jarek:~/code/airflow] main+ 101 ± 

@ashb
Copy link
Member

ashb commented Dec 17, 2024

@potiuk
Copy link
Member Author

potiuk commented Dec 17, 2024

Shell completion!

https://github.com/j178/prefligit/blob/921f86411cc2de04dbf94c696d572665bfca467f/src/main.rs#L235

🚀

That's what I was sincerely hoping for. This is main reason why we have breeze static-checks, another one are some predefined flags like --last-comit and --only-my-changes which I hope we might be able to contribute to prefligit once we get it working :)

@potiuk potiuk moved this from Ready to Backlog in CI / DEV ENV planned work Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code
Projects
Status: Backlog
Development

No branches or pull requests

2 participants