Metadata-Version: 2.1
Name: prevent-submodule-regression
Version: 0.1.0
Summary: Pre-commit hook to prevent accidental submodule regressions
Home-page: https://github.com/erikogan/prevent-submodule-regression
License: MPL-2.0
Keywords: precommit,pre-commit,submodule,regression
Author: Erik Ogan
Author-email: erik@ogan.net
Maintainer: Erik Ogan
Maintainer-email: erik@ogan.net
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: colorama (>=0.4.3,<0.5.0)
Project-URL: Repository, https://github.com/erikogan/prevent-submodule-regression
Description-Content-Type: text/markdown

# prevent-submodule-regression

Pre-commit hook to prevent accidental submodule regressions

## Description

Do you find yourself (or your collaborators) constantly rolling back submodule
SHAs because someone forgot to `git submodule update` before running `git add
.` or `git commit -a …`?

This pre-commit plugin will prevent those nasty surprises from making their
way into your repositories.

## Installation

### As a git hook

The simplest way to use this package is as a plugin to [pre-commit](https://pre-commit.com/).

A sample configuration:

```yaml
repos:
  # […]
  - repo: https://github.com/erikogan/prevent-submodule-regression
    rev: v0.1.0
    hooks:
      - id: prevent-submodule-regression
        # By default hooks only operat on plain files, which do not include
        # submodules. This setting has been added to the hook configuration,
        # but it is not consistently honored. The safest approach is to be
        # explicit in your configuration.
        types: [directory]
```

### As a standalone script

```
pip install prevent-submodule-regression [path…]
```

If you run the script with no arguments, it will automatically find all the
configured submodules. You can also pass it a list of files to check.

It will currently ignore any path that is not staged to be commit. A future
version of the script will have an argument to override that behavior.

## TODO

In no particular order:

* Actual tests
* A way to override the error and allow you to commit a regression.
  * Command-line
  * Environment variables
* Usage information via `--help`
* Actual command-line flag parsing

