Skip to content

Inspect git repositories and report best practices violations.

License

Notifications You must be signed in to change notification settings

yaniksoeltzer/git_inspector

Repository files navigation

Git-Inspector

<yaniksoeltzer> Code style: black

Inspect git repositories and report best practices violations.

example_output

What is reported

The different reports are generated by python modules in git_inspector/reports. So far the following reports are generated:

  • dirty.py reports repositories with a dirty working directory
  • merged.py reports branches, that are merged into the master branch and can be safely deleted
  • unpushed.py reports branches, that contain un-pushed commits
  • untrached_branches.py reports branches, that have no upstream
  • local.py reports local only repositories
  • broken_remote.py reports local remotes of which the remote directory does not exist
  • untracked.py reports branches, that are not tracked by a remote branch

Installation

1. Install with pip over https
python -m pip install git+https://github.com/yaniksoeltzer/git_inspector

Usage

usage: git_inspector [-h] [-l level] [path ...]

You can use git_inspector and git-inspector in like manner. For help about the usage run git-inspector --help.

Directory [path ...]

Provide one or multiple relative or absolute paths to the Git-Inspector.

# Inspect the home directory of the current user
git_inspector ~

# Inspect current directory
git_inspector .

# Inspect multiple directories
git_inspector ~/my_projects /opt/projects

Report Level [--report-level]

The Git-Inspector allows to set the report level, showing only reports with the provided report-level or a higher report-level. The report-level can be set to alert, warning, or hint using the --report-level / -l parameter. The default value is warning. To also show hints run

# Show everything
git_inspector -l hints

# Show only alerts and warnings
git_inspector -l warnings

# Show only alerts
git_inspector -l alerts

Uninstall Git-Inspector

To uninstall git_inspector run

> python -m pip uninstall git_inspector

About

Inspect git repositories and report best practices violations.

Topics

Resources

License

Stars

Watchers

Forks

Languages