Skip to main content

checkup-git

Git repository metrics plugin for checkup.

Installation

pip install checkup-git

Requirements

  • Python >= 3.12
  • checkup
  • Git installed on the system

Usage

from checkup import CheckHub
from checkup_git import (
    GitProvider,
    GitDaysSinceLastUpdateMetric,
    GitTrackedFileCountMetric,
)

results = (
    CheckHub()
    .with_metrics([
        GitDaysSinceLastUpdateMetric(),
        GitTrackedFileCountMetric(),
    ])
    .with_providers([[
        GitProvider("./my_repo"),
    ]])
    .measure()
)

Provider

GitProvider

Extracts metadata from a git repository, including the last commit date and list of tracked files.

Available Metrics

GitDaysSinceLastUpdateMetric

Returns the number of days since the last git commit.

GitTrackedFileCountMetric

Returns the number of git tracked files, optionally filtered by a glob pattern. Configure by subclassing:

from checkup_git import GitTrackedFileCountMetric

class PythonTestFileCountMetric(GitTrackedFileCountMetric):
    name = "python_test_file_count"
    description = "Number of Python test files"
    pattern = "tests/test_*.py"

Creating Custom Metrics

Extend GitMetric to create custom git-based metrics:

from checkup_git import GitMetric

class MyCustomGitMetric(GitMetric):
    name = "my_custom_metric"
    description = "My custom git metric"

    def calculate(self, context, measurements):
        git_context = self.get_context(context)
        tracked_files = git_context.get("git_tracked_files", [])
        python_files = [f for f in tracked_files if f.endswith(".py")]
        return self.measure(value=len(python_files))

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

checkup_git-0.4.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

checkup_git-0.4.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file checkup_git-0.4.2.tar.gz.

File metadata

  • Download URL: checkup_git-0.4.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for checkup_git-0.4.2.tar.gz
Algorithm Hash digest
SHA256 7d6d2b41a45c108bf671db56a5882532ceadc1bf7b6711aa52cedf52baa7de35
MD5 d803705ccc2aac35a6ebcb2da50663a6
BLAKE2b-256 9a4a2bccb1bfe0d79af1cefcd4fec3187b15e03e8276b4b54710715dbc743136

See more details on using hashes here.

File details

Details for the file checkup_git-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: checkup_git-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for checkup_git-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f535ab5fd861bf5a388d53643cb0f529a8782217fc943b2131ec5a409ced34b
MD5 2a67fd8316658fe7dbaeb4f252c4c1cb
BLAKE2b-256 41c184ec26756aa74a3cfc74dc80a64f99e1de8949c2261b65f81e126923b28d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page