diff --git a/Cargo.lock b/Cargo.lock index c966fd0d..e017a8d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -613,7 +613,7 @@ version = "0.1.0" dependencies = [ "hc_common", "hc_config", - "hc_git", + "hc_data", "hc_metric", "hc_report", ] @@ -674,37 +674,20 @@ dependencies = [ [[package]] name = "hc_data" version = "0.1.0" -dependencies = [ - "hc_common", - "hc_config", - "hc_eslint", - "hc_git", - "hc_github", - "hc_modules", - "hc_npm", - "hc_source", - "hc_version", - "petgraph", -] - -[[package]] -name = "hc_eslint" -version = "0.1.0" -dependencies = [ - "hc_common", - "tempfile", -] - -[[package]] -name = "hc_git" -version = "0.1.0" dependencies = [ "dirs", + "graphql_client", "hc_common", + "hc_config", "hc_git_command", - "hc_source", + "hc_hash", + "hc_serde", + "hc_shell", "hc_version", "nom", + "petgraph", + "tempfile", + "ureq", ] [[package]] @@ -714,17 +697,6 @@ dependencies = [ "hc_common", ] -[[package]] -name = "hc_github" -version = "0.1.0" -dependencies = [ - "graphql_client", - "hc_common", - "hc_git", - "hc_serde", - "ureq", -] - [[package]] name = "hc_hash" version = "0.1.0" @@ -749,7 +721,6 @@ dependencies = [ "hc_common", "hc_config", "hc_data", - "hc_git", "hc_linguist", "hc_math", "hc_shell", @@ -758,22 +729,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "hc_modules" -version = "0.1.0" -dependencies = [ - "dirs", - "hc_common", -] - -[[package]] -name = "hc_npm" -version = "0.1.0" -dependencies = [ - "dirs", - "hc_common", -] - [[package]] name = "hc_pm" version = "0.1.0" @@ -804,10 +759,10 @@ dependencies = [ "hc_analysis", "hc_common", "hc_config", + "hc_data", "hc_report", "hc_score", "hc_session", - "hc_source", ] [[package]] @@ -839,16 +794,12 @@ dependencies = [ "hc_common", "hc_config", "hc_data", - "hc_eslint", - "hc_git", "hc_linguist", "hc_metric", - "hc_npm", "hc_pm", "hc_report", "hc_score", "hc_shell", - "hc_source", "hc_spdx", "hc_version", "tempfile", @@ -867,16 +818,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "hc_source" -version = "0.1.0" -dependencies = [ - "hc_common", - "hc_git_command", - "hc_hash", - "hc_shell", -] - [[package]] name = "hc_spdx" version = "0.1.0" diff --git a/libs/hc_analysis/Cargo.toml b/libs/hc_analysis/Cargo.toml index 62f765a9..19c26b41 100644 --- a/libs/hc_analysis/Cargo.toml +++ b/libs/hc_analysis/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] hc_common = { path = "../hc_common" } -hc_git = { path = "../hc_git" } +hc_data = { path = "../hc_data" } hc_metric = { path = "../hc_metric" } hc_config = { path = "../hc_config" } hc_report = { path = "../hc_report" } \ No newline at end of file diff --git a/libs/hc_analysis/src/lib.rs b/libs/hc_analysis/src/lib.rs index fae0370d..ea3312a0 100644 --- a/libs/hc_analysis/src/lib.rs +++ b/libs/hc_analysis/src/lib.rs @@ -6,7 +6,7 @@ use hc_common::{ salsa, F64, }; use hc_config::{AttacksConfigQuery, CommitConfigQuery, FuzzConfigQuery, PracticesConfigQuery}; -use hc_git::GitProvider; +use hc_data::git::GitProvider; use hc_metric::{affiliation::AffiliatedType, MetricProvider}; use hc_report::{Concern, PrConcern}; use std::collections::{HashMap, HashSet}; diff --git a/libs/hc_data/Cargo.toml b/libs/hc_data/Cargo.toml index 5f5aa91b..7857370f 100644 --- a/libs/hc_data/Cargo.toml +++ b/libs/hc_data/Cargo.toml @@ -6,13 +6,19 @@ license = "Apache-2.0" publish = false [dependencies] +dirs = "5.0.1" +graphql_client = "0.14.0" hc_common = { path = "../hc_common" } hc_config = { path = "../hc_config" } -hc_eslint = { path = "../hc_eslint" } -hc_git = { path = "../hc_git" } -hc_github = { path = "../hc_github" } -hc_npm = { path = "../hc_npm" } -hc_source = { path = "../hc_source" } +hc_git_command = { path = "../hc_git_command" } +hc_hash = { path = "../hc_hash" } +hc_shell = { path = "../hc_shell" } hc_version = { path = "../hc_version" } -hc_modules = { path = "../hc_modules" } +nom = "7.1.3" petgraph = { version = "0.6.0", features = ["serde-1"] } +serde = { path = "../hc_serde", package = "hc_serde" } +ureq = { version = "2.9.7", default-features = false, features = ["json", "native-tls"] } + +[dev-dependencies] +dirs = "5.0.1" +tempfile = "3.2.0" diff --git a/libs/hc_data/src/code_quality.rs b/libs/hc_data/src/code_quality.rs index ae430435..bb2ff80b 100644 --- a/libs/hc_data/src/code_quality.rs +++ b/libs/hc_data/src/code_quality.rs @@ -2,9 +2,9 @@ use std::path::{Path, PathBuf}; +use crate::es_lint::data::{ESLintMessage, ESLintReports}; +use crate::es_lint::get_eslint_reports; use hc_common::{error::Result, hc_error}; -use hc_eslint::data::{ESLintMessage, ESLintReports}; -use hc_eslint::get_eslint_reports; pub type CodeQualityReport = Vec; diff --git a/libs/hc_eslint/src/command.rs b/libs/hc_data/src/es_lint/command.rs similarity index 100% rename from libs/hc_eslint/src/command.rs rename to libs/hc_data/src/es_lint/command.rs diff --git a/libs/hc_eslint/src/data.rs b/libs/hc_data/src/es_lint/data.rs similarity index 100% rename from libs/hc_eslint/src/data.rs rename to libs/hc_data/src/es_lint/data.rs diff --git a/libs/hc_eslint/src/lib.rs b/libs/hc_data/src/es_lint/mod.rs similarity index 98% rename from libs/hc_eslint/src/lib.rs rename to libs/hc_data/src/es_lint/mod.rs index b2ee3c57..e478d42a 100644 --- a/libs/hc_eslint/src/lib.rs +++ b/libs/hc_data/src/es_lint/mod.rs @@ -11,10 +11,12 @@ use hc_common::{error::Result, semver::Version, serde_json}; pub mod command; pub mod data; +#[allow(unused)] pub fn get_eslint_version() -> Result { ESLintCommand::internal([OsStr::new("--version")])?.output() } +#[allow(unused)] pub fn parse_eslint_version(version: &str) -> Result { // semver's parser will not accept the leading 'v' or trailing newline let version = version.strip_prefix('v').unwrap_or(version); diff --git a/libs/hc_git/src/data.rs b/libs/hc_data/src/git/data.rs similarity index 100% rename from libs/hc_git/src/data.rs rename to libs/hc_data/src/git/data.rs diff --git a/libs/hc_git/src/lib.rs b/libs/hc_data/src/git/mod.rs similarity index 99% rename from libs/hc_git/src/lib.rs rename to libs/hc_data/src/git/mod.rs index 06edfa41..17054e16 100644 --- a/libs/hc_git/src/lib.rs +++ b/libs/hc_data/src/git/mod.rs @@ -6,9 +6,9 @@ mod query; pub use data::*; pub use hc_git_command::*; +use parse::*; pub use query::*; -use crate::parse::*; use hc_common::context::Context as _; use hc_common::{ error::{Error, Result}, diff --git a/libs/hc_git/src/parse.rs b/libs/hc_data/src/git/parse.rs similarity index 99% rename from libs/hc_git/src/parse.rs rename to libs/hc_data/src/git/parse.rs index 7df6293e..9c6aac32 100644 --- a/libs/hc_git/src/parse.rs +++ b/libs/hc_data/src/git/parse.rs @@ -2,7 +2,7 @@ #![allow(dead_code)] -use crate::{Contributor, Diff, FileDiff, RawCommit}; +use crate::git::{Contributor, Diff, FileDiff, RawCommit}; use hc_common::context::Context as _; use hc_common::{ chrono::{DateTime, FixedOffset}, diff --git a/libs/hc_git/src/query/impls.rs b/libs/hc_data/src/git/query/impls.rs similarity index 99% rename from libs/hc_git/src/query/impls.rs rename to libs/hc_data/src/git/query/impls.rs index 62fd4896..0293a7ed 100644 --- a/libs/hc_git/src/query/impls.rs +++ b/libs/hc_data/src/git/query/impls.rs @@ -3,7 +3,7 @@ //! Derived query implementations for the `GitProvider` query group. use super::GitProvider; -use crate::{ +use crate::git::{ get_commits, get_commits_from_date, get_diffs, Commit, CommitContributor, CommitContributorView, CommitDiff, CommitSigner, CommitSignerView, Contributor, ContributorView, Diff, GitCommand, RawCommit, SignerKeyView, SignerNameView, SignerView, diff --git a/libs/hc_git/src/query/mod.rs b/libs/hc_data/src/git/query/mod.rs similarity index 94% rename from libs/hc_git/src/query/mod.rs rename to libs/hc_data/src/git/query/mod.rs index 8622a4ba..da1e8997 100644 --- a/libs/hc_git/src/query/mod.rs +++ b/libs/hc_data/src/git/query/mod.rs @@ -5,11 +5,14 @@ mod impls; use crate::{ - Commit, CommitContributor, CommitContributorView, CommitDiff, CommitSigner, CommitSignerView, - Contributor, ContributorView, Diff, RawCommit, SignerKeyView, SignerNameView, SignerView, + git::{ + Commit, CommitContributor, CommitContributorView, CommitDiff, CommitSigner, + CommitSignerView, Contributor, ContributorView, Diff, RawCommit, SignerKeyView, + SignerNameView, SignerView, + }, + source::SourceQuery, }; use hc_common::{chrono::prelude::*, error::Result, salsa}; -use hc_source::SourceQuery; use hc_version::VersionQuery; use std::rc::Rc; diff --git a/libs/hc_github/src/authenticated_agent.rs b/libs/hc_data/src/github/authenticated_agent.rs similarity index 97% rename from libs/hc_github/src/authenticated_agent.rs rename to libs/hc_data/src/github/authenticated_agent.rs index 15bda703..49804686 100644 --- a/libs/hc_github/src/authenticated_agent.rs +++ b/libs/hc_data/src/github/authenticated_agent.rs @@ -1,6 +1,6 @@ //! Defines an authenticated [`Agent`] type that adds token auth to all requests. -use crate::hidden::Hidden; +use crate::github::hidden::Hidden; use ureq::{Agent, Request}; /// An [`Agent`] which authenticates requests with token auth. diff --git a/libs/hc_github/src/code_search.rs b/libs/hc_data/src/github/code_search.rs similarity index 96% rename from libs/hc_github/src/code_search.rs rename to libs/hc_data/src/github/code_search.rs index 57011034..d2c80951 100644 --- a/libs/hc_github/src/code_search.rs +++ b/libs/hc_data/src/github/code_search.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 -use crate::authenticated_agent::AuthenticatedAgent; +use crate::github::authenticated_agent::AuthenticatedAgent; use hc_common::{ error::{Error, Result}, hc_error, diff --git a/libs/hc_github/src/data.rs b/libs/hc_data/src/github/data.rs similarity index 93% rename from libs/hc_github/src/data.rs rename to libs/hc_data/src/github/data.rs index 95eba003..b9827f05 100644 --- a/libs/hc_github/src/data.rs +++ b/libs/hc_data/src/github/data.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 -use hc_git::{Diff, RawCommit}; +use crate::git::{Diff, RawCommit}; use serde::Deserialize; #[derive(Debug, Deserialize)] diff --git a/libs/hc_github/src/gh_query.graphql b/libs/hc_data/src/github/gh_query.graphql similarity index 100% rename from libs/hc_github/src/gh_query.graphql rename to libs/hc_data/src/github/gh_query.graphql diff --git a/libs/hc_github/src/gh_schema.graphql b/libs/hc_data/src/github/gh_schema.graphql similarity index 100% rename from libs/hc_github/src/gh_schema.graphql rename to libs/hc_data/src/github/gh_schema.graphql diff --git a/libs/hc_github/src/graphql.rs b/libs/hc_data/src/github/graphql.rs similarity index 95% rename from libs/hc_github/src/graphql.rs rename to libs/hc_data/src/github/graphql.rs index a2465613..790b968a 100644 --- a/libs/hc_github/src/graphql.rs +++ b/libs/hc_data/src/github/graphql.rs @@ -3,7 +3,7 @@ use std::convert::TryInto; use self::reviews::{ResponseData, ReviewsRepositoryPullRequestsNodes as RawPull, Variables}; -use crate::{authenticated_agent::AuthenticatedAgent, data::*}; +use crate::github::{authenticated_agent::AuthenticatedAgent, data::*}; use graphql_client::{GraphQLQuery, QueryBody, Response}; use hc_common::{ error::{Error, Result}, @@ -17,8 +17,8 @@ const GH_API_V4: &str = "https://api.github.com/graphql"; /// Defines the query being made against the GitHub API. #[derive(GraphQLQuery)] #[graphql( - schema_path = "src/gh_schema.graphql", - query_path = "src/gh_query.graphql", + schema_path = "src/github/gh_schema.graphql", + query_path = "src/github/gh_query.graphql", response_derives = "Debug" )] pub struct Reviews; diff --git a/libs/hc_github/src/graphql_pr.rs b/libs/hc_data/src/github/graphql_pr.rs similarity index 97% rename from libs/hc_github/src/graphql_pr.rs rename to libs/hc_data/src/github/graphql_pr.rs index 9da354a9..251f21bd 100644 --- a/libs/hc_github/src/graphql_pr.rs +++ b/libs/hc_data/src/github/graphql_pr.rs @@ -4,7 +4,10 @@ use self::review::{ ResponseData, ReviewRepositoryPullRequest as RawPull, ReviewRepositoryPullRequestCommitsNodes as RawPullCommit, Variables, }; -use crate::{authenticated_agent::AuthenticatedAgent, data::*}; +use crate::{ + git::{Contributor, RawCommit}, + github::{authenticated_agent::AuthenticatedAgent, data::*}, +}; use graphql_client::{GraphQLQuery, QueryBody, Response}; use hc_common::{ chrono::DateTime, @@ -13,7 +16,6 @@ use hc_common::{ hc_error, serde_json::{from_value as from_json_value, to_value as to_json_value}, }; -use hc_git::{Contributor, RawCommit}; use std::convert::TryFrom; /// The URL of the GitHub GraphQL API. @@ -22,8 +24,8 @@ const GH_API_V4: &str = "https://api.github.com/graphql"; /// Defines the query being made against the GitHub API. #[derive(GraphQLQuery)] #[graphql( - schema_path = "src/gh_schema.graphql", - query_path = "src/gh_query.graphql", + schema_path = "src/github/gh_schema.graphql", + query_path = "src/github/gh_query.graphql", response_derives = "Debug" )] pub struct Review; diff --git a/libs/hc_github/src/hidden.rs b/libs/hc_data/src/github/hidden.rs similarity index 100% rename from libs/hc_github/src/hidden.rs rename to libs/hc_data/src/github/hidden.rs diff --git a/libs/hc_github/src/lib.rs b/libs/hc_data/src/github/mod.rs similarity index 90% rename from libs/hc_github/src/lib.rs rename to libs/hc_data/src/github/mod.rs index 2bb8a231..afd113fd 100644 --- a/libs/hc_github/src/lib.rs +++ b/libs/hc_data/src/github/mod.rs @@ -7,14 +7,14 @@ mod graphql; mod graphql_pr; mod hidden; -use crate::authenticated_agent::AuthenticatedAgent; use crate::code_search::search_code_request; -use crate::data::*; -use crate::graphql::get_all_reviews; -use crate::graphql_pr::get_all_pr_reviews; +use crate::git::parse::github_diff; +use crate::github::authenticated_agent::AuthenticatedAgent; +use crate::github::data::*; +use crate::github::graphql::get_all_reviews; +use crate::github::graphql_pr::get_all_pr_reviews; use hc_common::context::Context as _; use hc_common::{error::Result, log}; -use hc_git::parse::github_diff; use std::rc::Rc; pub struct GitHub<'a> { diff --git a/libs/hc_data/src/lib.rs b/libs/hc_data/src/lib.rs index bc6af8f3..4b59d2a7 100644 --- a/libs/hc_data/src/lib.rs +++ b/libs/hc_data/src/lib.rs @@ -3,14 +3,19 @@ //! Functions and types for data retrieval. mod code_quality; +mod es_lint; +pub mod git; +mod github; +mod modules; +pub mod npm; mod query; +pub mod source; -pub use hc_git as git; -pub use hc_modules as modules; -pub use hc_npm as npm; pub use query::*; use std::collections::HashSet; +use git::{get_commits_for_file, Commit, CommitContributor, Contributor, Diff}; +use github::*; use hc_common::{ context::Context, error::Error, @@ -18,9 +23,7 @@ use hc_common::{ hc_error, log, pathbuf, serde::{self, Serialize}, }; -use hc_git::{get_commits_for_file, Commit, CommitContributor, Contributor, Diff}; -use hc_github::*; -use hc_modules::RawModule; +use modules::RawModule; use petgraph::visit::Dfs; use petgraph::Graph; use std::path::Path; diff --git a/libs/hc_modules/src/lib.rs b/libs/hc_data/src/modules.rs similarity index 98% rename from libs/hc_modules/src/lib.rs rename to libs/hc_data/src/modules.rs index f16edfdd..252fdbfa 100644 --- a/libs/hc_modules/src/lib.rs +++ b/libs/hc_data/src/modules.rs @@ -143,7 +143,7 @@ impl ModuleDepsCommand { // for _ in 0..4 { // path.pop(); // } -// path.push("libs/hc_modules/src/testpkg"); +// path.push("libs/hc_data/src/modules/testpkg"); // Ok(path) // } diff --git a/libs/hc_npm/src/lib.rs b/libs/hc_data/src/npm.rs similarity index 100% rename from libs/hc_npm/src/lib.rs rename to libs/hc_data/src/npm.rs diff --git a/libs/hc_data/src/query/code_quality.rs b/libs/hc_data/src/query/code_quality.rs index f7242686..ed18a5eb 100644 --- a/libs/hc_data/src/query/code_quality.rs +++ b/libs/hc_data/src/query/code_quality.rs @@ -5,8 +5,8 @@ use std::rc::Rc; use crate::code_quality::{get_eslint_report, CodeQualityReport}; +use crate::source::SourceQuery; use hc_common::{error::Result, salsa}; -use hc_source::SourceQuery; use hc_version::VersionQuery; /// Queries about code quality diff --git a/libs/hc_data/src/query/dependencies.rs b/libs/hc_data/src/query/dependencies.rs index 2266301c..bbd3f12d 100644 --- a/libs/hc_data/src/query/dependencies.rs +++ b/libs/hc_data/src/query/dependencies.rs @@ -3,9 +3,9 @@ //! Query group for dependencies information. use crate::npm::{get_package_file, PackageFile}; +use crate::source::SourceQuery; use crate::Dependencies; use hc_common::{error::Result, salsa}; -use hc_source::SourceQuery; use hc_version::VersionQuery; use std::rc::Rc; diff --git a/libs/hc_data/src/query/github.rs b/libs/hc_data/src/query/github.rs index 398ff846..65e8f836 100644 --- a/libs/hc_data/src/query/github.rs +++ b/libs/hc_data/src/query/github.rs @@ -2,11 +2,11 @@ //! Query group for data pertaining to a remote GitHub source. +use crate::source::{Remote, SourceQuery}; use hc_common::{ error::{Error, Result}, salsa, }; -use hc_source::{Remote, SourceQuery}; use std::rc::Rc; /// Queries about a remote GitHub source diff --git a/libs/hc_data/src/query/module.rs b/libs/hc_data/src/query/module.rs index 5588f904..ddf941dd 100644 --- a/libs/hc_data/src/query/module.rs +++ b/libs/hc_data/src/query/module.rs @@ -4,13 +4,16 @@ use std::{path::PathBuf, rc::Rc}; -use crate::{associate_modules_and_commits, Module, ModuleGraph}; +use crate::{ + associate_modules_and_commits, + git::{Commit, GitProvider}, + Module, ModuleGraph, +}; use hc_common::{ error::{Error, Result}, pathbuf, salsa, }; -use hc_git::{Commit, GitProvider}; /// A module and an associated commit pub type ModuleCommitMap = Rc, Rc)>>; diff --git a/libs/hc_data/src/query/pr_review.rs b/libs/hc_data/src/query/pr_review.rs index 65e6f186..dee99579 100644 --- a/libs/hc_data/src/query/pr_review.rs +++ b/libs/hc_data/src/query/pr_review.rs @@ -4,8 +4,9 @@ use super::github::GitHubProvider; use crate::{ - get_pull_request_reviews_from_github, get_single_pull_request_review_from_github, PullRequest, - SinglePullRequest, + get_pull_request_reviews_from_github, get_single_pull_request_review_from_github, + git::{Commit, CommitContributorView, CommitDiff, Contributor, ContributorView}, + PullRequest, SinglePullRequest, }; use hc_common::{ context::Context, @@ -13,7 +14,6 @@ use hc_common::{ salsa, }; use hc_config::ConfigSource; -use hc_git::{Commit, CommitContributorView, CommitDiff, Contributor, ContributorView}; use std::rc::Rc; /// A query that provides GitHub pull request reviews diff --git a/libs/hc_source/src/lib.rs b/libs/hc_data/src/source/mod.rs similarity index 100% rename from libs/hc_source/src/lib.rs rename to libs/hc_data/src/source/mod.rs diff --git a/libs/hc_source/src/query.rs b/libs/hc_data/src/source/query.rs similarity index 97% rename from libs/hc_source/src/query.rs rename to libs/hc_data/src/source/query.rs index dba70fe2..79ae11bf 100644 --- a/libs/hc_source/src/query.rs +++ b/libs/hc_data/src/source/query.rs @@ -2,7 +2,7 @@ //! A query group for accessing Git repository data. -use crate::{Remote, Source}; +use crate::source::{Remote, Source}; use hc_common::{pathbuf, salsa}; use hc_hash::hash; use std::path::PathBuf; @@ -67,7 +67,7 @@ fn url(db: &dyn SourceQuery) -> Option> { // Computes the appropriate path based on the remote or local info fn storage_path(db: &dyn SourceQuery) -> Rc { - use Remote::*; + use crate::source::Remote::*; let path_buf = match db.remote() { Some(remote) => match remote.as_ref() { diff --git a/libs/hc_eslint/Cargo.toml b/libs/hc_eslint/Cargo.toml deleted file mode 100644 index e2d0673f..00000000 --- a/libs/hc_eslint/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "hc_eslint" -version = "0.1.0" -edition = "2021" -license = "Apache-2.0" -publish = false - -[dependencies] -hc_common = { path = "../hc_common" } - -[dev-dependencies] -tempfile = "3.2.0" diff --git a/libs/hc_git/Cargo.toml b/libs/hc_git/Cargo.toml deleted file mode 100644 index 8f4deb8d..00000000 --- a/libs/hc_git/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "hc_git" -version = "0.1.0" -edition = "2021" -license = "Apache-2.0" -publish = false - -[dependencies] -hc_common = { path = "../hc_common" } -hc_git_command = { path = "../hc_git_command" } -hc_source = { path = "../hc_source" } -hc_version = { path = "../hc_version" } -nom = "7.1.3" - -[dev-dependencies] -dirs = "5.0.1" diff --git a/libs/hc_github/Cargo.toml b/libs/hc_github/Cargo.toml deleted file mode 100644 index 07a60728..00000000 --- a/libs/hc_github/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "hc_github" -version = "0.1.0" -edition = "2021" -license = "Apache-2.0" -publish = false - -[dependencies] -hc_common = { path = "../hc_common" } -hc_git = { path = "../hc_git" } -# Alias supports graphql_client derive macros -serde = { path = "../hc_serde", package = "hc_serde" } -graphql_client = "0.14.0" -ureq = { version = "2.9.7", default-features = false, features = ["json", "native-tls"] } diff --git a/libs/hc_metric/Cargo.toml b/libs/hc_metric/Cargo.toml index cc054c4e..08dadedf 100644 --- a/libs/hc_metric/Cargo.toml +++ b/libs/hc_metric/Cargo.toml @@ -10,7 +10,6 @@ hc_binary = { path = "../hc_binary" } hc_common = { path = "../hc_common" } hc_config = { path = "../hc_config" } hc_data = { path = "../hc_data" } -hc_git = { path = "../hc_git" } hc_linguist = { path = "../hc_linguist" } hc_math = { path = "../hc_math" } hc_shell = { path = "../hc_shell" } diff --git a/libs/hc_metric/src/lib.rs b/libs/hc_metric/src/lib.rs index 6fe919dd..b0a1fbbb 100644 --- a/libs/hc_metric/src/lib.rs +++ b/libs/hc_metric/src/lib.rs @@ -27,8 +27,9 @@ use fuzz::FuzzOutput; use hc_binary::BinaryFile; use hc_common::{error::Result, salsa}; use hc_config::{AttacksConfigQuery, CommitConfigQuery}; -use hc_data::{DependenciesProvider, FuzzProvider, ModuleProvider, PullRequestReviewProvider}; -use hc_git::GitProvider; +use hc_data::{ + git::GitProvider, DependenciesProvider, FuzzProvider, ModuleProvider, PullRequestReviewProvider, +}; use hc_linguist::Linguist; use identity::IdentityOutput; use module::ModuleOutput; diff --git a/libs/hc_metric/src/module_contributors.rs b/libs/hc_metric/src/module_contributors.rs index 0dc0270a..1965c7bf 100644 --- a/libs/hc_metric/src/module_contributors.rs +++ b/libs/hc_metric/src/module_contributors.rs @@ -7,8 +7,7 @@ use hc_common::{ log, serde::{self, Serialize}, }; -use hc_data::Module; -use hc_git::Contributor; +use hc_data::{git::Contributor, Module}; use std::{collections::HashMap, rc::Rc}; #[derive(Debug, Eq, PartialEq, Serialize)] diff --git a/libs/hc_modules/Cargo.toml b/libs/hc_modules/Cargo.toml deleted file mode 100644 index 5daf2a0b..00000000 --- a/libs/hc_modules/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "hc_modules" -version = "0.1.0" -edition = "2021" -license = "Apache-2.0" -publish = false - -[dependencies] -dirs = "5.0.1" -hc_common = { path = "../hc_common" } diff --git a/libs/hc_npm/Cargo.toml b/libs/hc_npm/Cargo.toml deleted file mode 100644 index 01bce0f0..00000000 --- a/libs/hc_npm/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "hc_npm" -version = "0.1.0" -edition = "2021" -license = "Apache-2.0" -publish = false - -[dependencies] -hc_common = { path = "../hc_common" } - -[dev-dependencies] -dirs = "5.0.1" diff --git a/libs/hc_report_builder/Cargo.toml b/libs/hc_report_builder/Cargo.toml index 48270fec..137834da 100644 --- a/libs/hc_report_builder/Cargo.toml +++ b/libs/hc_report_builder/Cargo.toml @@ -9,7 +9,7 @@ publish = false hc_analysis = { path = "../hc_analysis" } hc_common = { path = "../hc_common" } hc_config = { path = "../hc_config" } +hc_data = { path = "../hc_data" } hc_report = { path = "../hc_report" } hc_score = { path = "../hc_score" } hc_session = { path = "../hc_session" } -hc_source = { path = "../hc_source" } diff --git a/libs/hc_report_builder/src/lib.rs b/libs/hc_report_builder/src/lib.rs index 1c089c8d..27013096 100644 --- a/libs/hc_report_builder/src/lib.rs +++ b/libs/hc_report_builder/src/lib.rs @@ -6,10 +6,10 @@ use hc_common::{ hc_error, log, }; use hc_config::RiskConfigQuery; +use hc_data::source::SourceQuery; pub use hc_report::*; use hc_score::ScoringResults; use hc_session::Session; -use hc_source::SourceQuery; use std::default::Default; use std::result::Result as StdResult; diff --git a/libs/hc_session/Cargo.toml b/libs/hc_session/Cargo.toml index 066a12f6..06389e6e 100644 --- a/libs/hc_session/Cargo.toml +++ b/libs/hc_session/Cargo.toml @@ -13,16 +13,12 @@ hc_binary = { path = "../hc_binary" } hc_common = { path = "../hc_common" } hc_config = { path = "../hc_config" } hc_data = { path = "../hc_data" } -hc_eslint = { path = "../hc_eslint" } -hc_git = { path = "../hc_git" } hc_linguist = { path = "../hc_linguist" } hc_metric = { path = "../hc_metric" } -hc_npm = { path = "../hc_npm" } hc_pm = { path = "../hc_pm" } hc_report = { path = "../hc_report" } hc_score = { path = "../hc_score" } hc_shell = { path = "../hc_shell" } -hc_source = { path = "../hc_source" } hc_spdx = { path = "../hc_spdx" } hc_version = { path = "../hc_version" } diff --git a/libs/hc_session/src/lib.rs b/libs/hc_session/src/lib.rs index a484048b..9782455c 100644 --- a/libs/hc_session/src/lib.rs +++ b/libs/hc_session/src/lib.rs @@ -18,20 +18,20 @@ use hc_config::{ }; use hc_data::ModuleProvider; use hc_data::{ + git::get_git_version, + git::GitProviderStorage, + npm::get_npm_version, + source::{ + Source, SourceChangeRequest, SourceKind, SourceQuery, SourceQueryStorage, SourceRepo, + }, CodeQualityProviderStorage, DependenciesProviderStorage, FuzzProviderStorage, GitHubProviderStorage, ModuleProviderStorage, PullRequestReviewProviderStorage, }; -use hc_git::get_git_version; -use hc_git::GitProviderStorage; use hc_linguist::LinguistStorage; use hc_metric::MetricProviderStorage; -use hc_npm::get_npm_version; use hc_report::{Format, ReportParams, ReportParamsStorage}; use hc_score::ScoringProviderStorage; use hc_shell::{Phase, Shell}; -use hc_source::{ - Source, SourceChangeRequest, SourceKind, SourceQuery, SourceQueryStorage, SourceRepo, -}; use hc_version::{get_version, VersionQuery, VersionQueryStorage}; use std::ffi::{OsStr, OsString}; use std::fmt; diff --git a/libs/hc_source/Cargo.toml b/libs/hc_source/Cargo.toml deleted file mode 100644 index eeeff2f3..00000000 --- a/libs/hc_source/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "hc_source" -version = "0.1.0" -edition = "2021" -license = "Apache-2.0" -publish = false - -[dependencies] -hc_common = { path = "../hc_common" } -hc_git_command = { path = "../hc_git_command" } -hc_hash = { path = "../hc_hash" } -hc_shell = { path = "../hc_shell" } -