You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the 3rd commit we have removed libc so that the code no longer compiles. However the cargo-check step is skipped, so this is not caught :(
Running pre-commit run --all-files manually results in:
fmt......................................................................Passed
cargo check..............................................................Failed
- hook id: cargo-check
- exit code: 101
Checking test-pre-commit v0.1.0 (/tmp/test-pre-commit)
error[E0433]: failed to resolve: use of undeclared crate or module `libc`
--> src/main.rs:2:22
|
2 | let r = unsafe { libc::rand() };
| ^^^^ use of undeclared crate or module `libc`
For more information about this error, try `rustc --explain E0433`.
error: could not compile `test-pre-commit` (bin "test-pre-commit") due to 1 previous error
The text was updated successfully, but these errors were encountered:
tyilo
changed the title
Run hooks when only Cargo.toml and/or Cargo.lock has changed
Also run hooks when only Cargo.toml and/or Cargo.lock has changed
May 17, 2024
Both the
cargo-check
andclippy
hooks should also be run if onlyCargo.toml
and/orCargo.lock
has been changed.The following shows the problem:
In the 3rd commit we have removed
libc
so that the code no longer compiles. However thecargo-check
step is skipped, so this is not caught :(Running
pre-commit run --all-files
manually results in:The text was updated successfully, but these errors were encountered: