Merge pull request #1931 from gitbutlerapp/rename-mod-modules-to-named-modules

rename `.mod` modules to named modules
This commit is contained in:
Qix 2023-12-05 16:03:54 +01:00 committed by GitHub
commit 615c333ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 59 additions and 24 deletions

View File

@ -66,6 +66,8 @@ unneeded_field_pattern = "deny"
unseparated_literal_suffix = "deny"
if_then_some_else_none = "deny"
use_debug = "deny"
mod_module_files = "deny"
self_named_module_files = "allow"
# TODO
# partial_pub_fields = "deny"
# print_stdout = "deny"

View File

@ -0,0 +1,35 @@
mod branches;
pub use branches::Branches;
mod clear;
pub use clear::Clear;
mod commit;
pub use commit::Commit;
mod flush;
pub use flush::Flush;
mod info;
pub use info::Info;
mod mv;
pub use mv::Move;
mod new;
pub use new::New;
mod remotes;
pub use remotes::Remotes;
mod reset;
pub use reset::Reset;
mod run;
pub use run::RunCommand;
mod setup;
pub use setup::Setup;
mod status;
pub use status::Status;

View File

@ -1,6 +1,6 @@
use std::path;
#![allow(unused)]
use gblib::git;
use std::path;
pub fn temp_dir() -> std::path::PathBuf {
tempfile::tempdir()
@ -250,3 +250,12 @@ impl TestProject {
submodule.add_finalize().unwrap();
}
}
pub mod paths {
use super::temp_dir;
use gblib::paths::DataDir;
pub fn data_dir() -> DataDir {
DataDir::from(temp_dir())
}
}

View File

@ -1,8 +1,8 @@
use std::path;
mod common;
use self::common::{paths, TestProject};
use gblib::{gb_repository, git, project_repository, projects};
use crate::{common::TestProject, paths};
use std::path;
mod init {
use super::*;

View File

@ -1,7 +0,0 @@
#![allow(clippy::dbg_macro)]
mod common;
mod gb_repository;
mod paths;
mod projects;
mod virtual_branches;

View File

@ -1,7 +0,0 @@
use gblib::paths::DataDir;
use crate::common::temp_dir;
pub fn data_dir() -> DataDir {
DataDir::from(temp_dir())
}

View File

@ -1,6 +1,7 @@
use gblib::projects::Controller;
mod common;
use crate::{common, paths};
use self::common::paths;
use gblib::projects::Controller;
pub fn new() -> Controller {
let data_dir = paths::data_dir();

View File

@ -1,9 +1,13 @@
//TODO:
#![allow(
clippy::redundant_closure_for_method_calls,
clippy::rest_pat_in_fully_bound_structs
clippy::rest_pat_in_fully_bound_structs,
clippy::dbg_macro
)]
mod common;
use self::common::{paths, TestProject};
use std::{fs, path, str::FromStr};
use gblib::{
@ -14,8 +18,6 @@ use gblib::{
virtual_branches::{branch, controller::ControllerError, errors, Controller},
};
use crate::{common::TestProject, paths};
struct Test {
repository: TestProject,
project_id: ProjectId,