GitModule.Behaviour behaviour (LowEndInsight v0.9.0)

Copy Markdown View Source

Behaviour definition for GitModule operations.

This allows for mocking git operations in tests using Mox.

Summary

Types

repo()

@type repo() :: Git.Repository.t()

Callbacks

clone_repo(t, t)

@callback clone_repo(String.t(), String.t()) :: {:ok, repo()} | {:error, String.t()}

delete_repo(repo)

@callback delete_repo(repo()) :: [binary()]

get_clean_contributions_map(repo)

@callback get_clean_contributions_map(repo()) :: {:ok, list()}

get_commit_dates(repo)

@callback get_commit_dates(repo()) :: {:ok, [non_neg_integer()]}

get_contributions_map(repo)

@callback get_contributions_map(repo()) ::
  {:ok, [%{contributions: non_neg_integer(), name: String.t()}]}

get_contributor_count(repo)

@callback get_contributor_count(repo()) :: {:ok, non_neg_integer()}

get_contributor_distribution(repo)

@callback get_contributor_distribution(repo()) :: {:ok, map(), non_neg_integer()}

get_contributors(repo)

@callback get_contributors(repo()) :: {:ok, [Contributor.t()]}

get_default_branch(repo)

@callback get_default_branch(repo()) :: {:ok, String.t()}

get_diff_2_commits(repo, list)

@callback get_diff_2_commits(repo(), [any()]) :: {:ok, [String.t()]} | []

get_functional_contributors(repo)

@callback get_functional_contributors(repo()) :: {:ok, non_neg_integer(), [any()]}

get_hash(repo)

@callback get_hash(repo()) :: {:ok, String.t()}

get_last_2_delta(repo)

@callback get_last_2_delta(repo()) ::
  {:ok, non_neg_integer(), non_neg_integer(), non_neg_integer()}

get_last_commit_date(repo)

@callback get_last_commit_date(repo()) :: {:ok, String.t()}

get_last_contribution_date_by_contributor(repo, t)

@callback get_last_contribution_date_by_contributor(repo(), String.t()) ::
  String.t() | nil

get_last_n_commits(repo, non_neg_integer)

@callback get_last_n_commits(repo(), non_neg_integer()) :: {:ok, [any()]}

get_recent_changes(repo)

@callback get_recent_changes(repo()) :: {:ok, number(), number()}

get_repo(t)

@callback get_repo(String.t()) :: {:ok, repo()} | {:error, String.t()}

get_repo_size(repo)

@callback get_repo_size(repo()) :: {:ok, String.t()}

get_tag_and_commit_dates(repo)

@callback get_tag_and_commit_dates(repo()) :: {:ok, [list()]}

get_top10_contributors_map(repo)

@callback get_top10_contributors_map(repo()) :: {:ok, [any()]}

get_total_commit_count(repo)

@callback get_total_commit_count(repo()) :: {:ok, non_neg_integer() | String.t()}

get_total_lines(repo)

@callback get_total_lines(repo()) :: {:ok, non_neg_integer(), non_neg_integer()}