Skip to content

Commit

Permalink
Revert "lint: fix check_* functions (clippy::module_name_repetitions)"
Browse files Browse the repository at this point in the history
This reverts commit f888339.
  • Loading branch information
willbush committed Oct 30, 2024
1 parent 3a30256 commit b57e201
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use std::{panic, thread};

use crate::nix_file::NixFileStore;
use crate::status::{ColoredStatus, Status};
use crate::structure::check_structure;
use crate::validation::Validation::Failure;
use crate::validation::Validation::Success;

Expand Down Expand Up @@ -112,7 +113,7 @@ fn check_nixpkgs(nixpkgs_path: &Path) -> validation::Result<ratchet::Nixpkgs> {
}

let mut nix_file_store = NixFileStore::default();
let structure = structure::check(&nixpkgs_path, &mut nix_file_store)?;
let structure = check_structure(&nixpkgs_path, &mut nix_file_store)?;

// Only if we could successfully parse the structure, we do the evaluation checks
let result = structure.result_map(|package_names| {
Expand Down
2 changes: 1 addition & 1 deletion src/references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::NixFileStore;

/// Check that every package directory in pkgs/by-name doesn't link to outside that directory.
/// Both symlinks and Nix path expressions are checked.
pub fn check(
pub fn check_references(
nix_file_store: &mut NixFileStore,
relative_package_dir: &RelativePath,
absolute_package_dir: &Path,
Expand Down
7 changes: 5 additions & 2 deletions src/structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ pub fn relative_file_for_package(package_name: &str) -> RelativePathBuf {

/// Check the structure of Nixpkgs, returning the attribute names that are defined in
/// `pkgs/by-name`
pub fn check(path: &Path, nix_file_store: &mut NixFileStore) -> validation::Result<Vec<String>> {
pub fn check_structure(
path: &Path,
nix_file_store: &mut NixFileStore,
) -> validation::Result<Vec<String>> {
let base_dir = path.join(BASE_SUBPATH);

let shard_results = read_dir_sorted(&base_dir)?
Expand Down Expand Up @@ -167,7 +170,7 @@ fn check_package(
Success(())
});

let result = result.and(references::check(
let result = result.and(references::check_references(
nix_file_store,
&relative_package_dir,
&relative_package_dir.to_path(path),
Expand Down

0 comments on commit b57e201

Please sign in to comment.