Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "codeowners"
version = "0.2.3"
edition = "2021"
edition = "2024"

[profile.release]
debug = true
Expand All @@ -16,7 +16,7 @@ error-stack = "0.5.0"
enum_dispatch = "0.3.13"
fast-glob = "0.4.0"
ignore = "0.4.23"
itertools = "0.13.0"
itertools = "0.14.0"
lazy_static = "1.5.0"
path-clean = "1.0.1"
rayon = "1.10.0"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.83.0"
channel = "1.85.0"
components = ["clippy", "rustfmt"]
targets = ["x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-unknown-linux-gnu"]
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Parser, Subcommand};
use codeowners::{
cache::{file::GlobalCache, noop::NoopCache, Cache, Caching},
cache::{Cache, Caching, file::GlobalCache, noop::NoopCache},
config::Config,
ownership::{FileOwner, Ownership},
project_builder::ProjectBuilder,
Expand Down
2 changes: 1 addition & 1 deletion src/common_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub mod tests {
use tempfile::tempdir;

use crate::{
cache::{noop::NoopCache, Cache},
cache::{Cache, noop::NoopCache},
config::Config,
ownership::Ownership,
project_builder::ProjectBuilder,
Expand Down
18 changes: 9 additions & 9 deletions src/ownership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ pub struct Entry {
impl Entry {
fn to_row(&self) -> String {
let line = format!("/{} {}", self.path, self.github_team);
if self.disabled {
format!("# {}", line)
} else {
line
}
if self.disabled { format!("# {}", line) } else { line }
}
}

Expand Down Expand Up @@ -379,8 +375,10 @@ mod tests {
"};

let team_ownership = parse_for_team("@Foo".to_string(), codeownership_file);
assert!(team_ownership
.is_err_and(|e| e.to_string() == "CODEOWNERS out of date. Run `codeowners generate` to update the CODEOWNERS file"));
assert!(
team_ownership
.is_err_and(|e| e.to_string() == "CODEOWNERS out of date. Run `codeowners generate` to update the CODEOWNERS file")
);
Ok(())
}

Expand All @@ -392,8 +390,10 @@ mod tests {
"};

let team_ownership = parse_for_team("@Foo".to_string(), codeownership_file);
assert!(team_ownership
.is_err_and(|e| e.to_string() == "CODEOWNERS out of date. Run `codeowners generate` to update the CODEOWNERS file"));
assert!(
team_ownership
.is_err_and(|e| e.to_string() == "CODEOWNERS out of date. Run `codeowners generate` to update the CODEOWNERS file")
);
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion src/ownership/file_owner_finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<'a> DirectoryOverrider<'a> {
fn process(&mut self, team_name: &'a TeamName, source: &'a Source) {
if self
.specific_directory_owner
.map_or(true, |(_, current_source)| current_source.len() < source.len())
.is_none_or(|(_, current_source)| current_source.len() < source.len())
{
self.specific_directory_owner = Some((team_name, source));
}
Expand Down
2 changes: 1 addition & 1 deletion src/ownership/mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl OwnerMatcher {
(None, source)
}
}
OwnerMatcher::ExactMatches(ref path_to_team, source) => (path_to_team.get(relative_path), source),
OwnerMatcher::ExactMatches(path_to_team, source) => (path_to_team.get(relative_path), source),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ownership/mapper/team_file_mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::Arc;

use super::escaper::escape_brackets;
use super::Entry;
use super::escaper::escape_brackets;
use super::{Mapper, OwnerMatcher};
use crate::ownership::mapper::Source;
use crate::project::Project;
Expand Down
2 changes: 1 addition & 1 deletion src/project_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tracing::instrument;
use crate::{
cache::Cache,
config::Config,
project::{deserializers, DirectoryCodeownersFile, Error, Package, PackageType, Project, ProjectFile, Team, VendoredGem},
project::{DirectoryCodeownersFile, Error, Package, PackageType, Project, ProjectFile, Team, VendoredGem, deserializers},
project_file_builder::ProjectFileBuilder,
};

Expand Down
2 changes: 1 addition & 1 deletion src/project_file_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn build_project_file_without_cache(path: &PathBuf) -> ProjectFile {
return ProjectFile {
path: path.clone(),
owner: None,
}
};
}
};

Expand Down