Skip to content

Commit

Permalink
Upgrade rust to 1.84 and upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Feb 6, 2025
1 parent b5a75a7 commit a1d471f
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 64 deletions.
235 changes: 186 additions & 49 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,34 @@ ctrlc = "3.4.5"
dunce = "1.0.5"
etcetera = "0.8.0"
fancy-regex = "0.14.0"
fs-err = "2.11.0"
fs-err = "3.1.0"
fs2 = "0.4.3"
futures = "0.3.31"
http = "1.1.0"
indicatif = "0.17.8"
indoc = "2.0.5"
itertools = "0.13.0"
md5 = "0.7.0"
miette = { version = "7.2.0", features = ["owo-colors", "textwrap"] }
itertools = "0.14.0"
md-5 = "0.10.6"
miette = { version = "7.5.0", features = ["fancy-no-backtrace"] }
owo-colors = "4.1.0"
rand = "0.8.5"
rand = "0.9.0"
rayon = "1.10.0"
reqwest = { version = "0.12.9", default-features = false }
rusqlite = { version = "0.32.1", features = ["bundled"] }
rusqlite = { version = "0.33.0", features = ["bundled"] }
same-file = "1.0.6"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.132"
serde_yaml = "0.9.34"
shlex = "1.3.0"
tempfile = "3.13.0"
textwrap = "0.16.1"
thiserror = "1.0.64"
thiserror = "2.0.11"
tokio = { version = "1.40.0", features = ["fs", "process", "rt", "sync", "macros"] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
unicode-width = "0.2.0"
url = { version = "2.5.2", features = ["serde"] }
which = "6.0.3"
which = "7.0.1"

[target.'cfg(unix)'.dependencies]
libc = "0.2.164"
Expand All @@ -70,7 +70,7 @@ predicates = "3.1.2"
regex = "1.11.0"

[build-dependencies]
fs-err = "2.11.0"
fs-err = "3.1.0"

[lints.rust]
dead_code = "allow"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ cargo binstall prefligit

## Usage

This tool is designed to be a drop-in replacement for the original pre-commit tool, so you can use it with your existing configurations and hooks.
This tool is designed to be a drop-in alternative for the original pre-commit tool, so you can use it with your existing configurations and hooks.

Please refer to the [official documentation](https://pre-commit.com/) for more information on how to configure and use pre-commit.

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.83"
channel = "1.84"
2 changes: 1 addition & 1 deletion src/builtin/pre_commit_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub(crate) async fn fix_trailing_whitespace(
.and_then(|ext| ext.to_str())
.map(|ext| format!(".{}", ext.to_ascii_lowercase()));
let is_markdown =
force_markdown || ext.map_or(false, |ext| markdown_exts.contains(&ext));
force_markdown || ext.is_some_and(|ext| markdown_exts.contains(&ext));

let content = tokio::fs::read(filename).await?;

Expand Down
2 changes: 1 addition & 1 deletion src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl LockedFile {

impl Drop for LockedFile {
fn drop(&mut self) {
if let Err(err) = self.0.file().unlock() {
if let Err(err) = FileExt::unlock(self.0.file()) {
error!(
"Failed to unlock {}; program may be stuck: {}",
self.0.path().display(),
Expand Down
2 changes: 1 addition & 1 deletion src/identify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ pub fn tags_from_path(path: &Path) -> Result<Vec<&str>> {
#[cfg(not(unix))]
let executable = {
let ext = path.extension().and_then(|ext| ext.to_str());
ext.map_or(false, |ext| ext == "exe" || ext == "bat" || ext == "cmd")
ext.is_some_and(|ext| ext == "exe" || ext == "bat" || ext == "cmd")
};

if executable {
Expand Down
3 changes: 2 additions & 1 deletion src/languages/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::sync::Arc;
use anstream::ColorChoice;
use anyhow::Result;
use fancy_regex::Regex;
use md5::Digest;
use tracing::trace;

use crate::fs::CWD;
Expand All @@ -25,7 +26,7 @@ impl Docker {
hook.path()
.file_name()
.and_then(OsStr::to_str)
.map(|s| format!("pre-commit-{:x}", md5::compute(s)))
.map(|s| format!("pre-commit-{:x}", md5::Md5::digest(s)))
}

async fn build_docker_image(hook: &Hook, pull: bool) -> Result<()> {
Expand Down

0 comments on commit a1d471f

Please sign in to comment.