CLI to check if any of the original files in a repository/directory change over the course of a precommit script.
Project description
ChangeGuard
Status | Stable | Unstable | ||
---|---|---|---|---|
Master | ||||
Develop |
CLI to check if your repository/directory files have changed over the span of a script.
What
Like hashdeep, but customized to check if any of the original files in a repository/directory change over the course of a precommit script.
Features
- Can use any sha256sum-like command (uses xxhash by default).
Getting Started
Install
Tested on
- WSL2 Ubuntu 20.04, Python 3.8.0
- Ubuntu 20.04, Python 3.8.0, 3.9.0, 3.10.0, 3.11.0, 3.12.0, tested in GitHub Actions workflow (build-and-test.yml).
Requirements:
- Linux-like environment
- Why: Uses pexpect.spawn().
- Python 3.8+
- Why: Some dev dependencies require Python 3.8+.
# Install from pypi (https://pypi.org/project/changeguard/)
pip install changeguard
# Install from git (https://github.com/realazthat/changeguard)
pip install git+https://github.com/realazthat/changeguard.git@v0.0.0
Use
Contributions
Development environment: Linux-like
- For running
pre.sh
(Linux-like environment).- Requires
pyenv
, or an exact matching version of python as in.python-version
. nvm
for prettier (markdown formatting).bash
,grep
,xxd
,git
,xxhash
(for scripts/workflows/tests).jq
, (installation) required for yq, which is itself required for ourREADME.md
generation, which usestomlq
(from the yq package) to include version strings frompyproject.toml
.- Requires
nodejs
(for act). - Requires
go
(to run act). docker
(for act).
- Requires
Commit Process
- (Optionally) Fork the
develop
branch. - Stage your files:
git add path/to/file.py
. bash scripts/pre.sh
, this will format, lint, and test the code.git status
check if anything changed (generatedREADME.md
for example), if so,git add
the changes, and go back to the previous step.git commit -m "..."
.- Make a PR to
develop
(or push to develop if you have the rights).
Release Process
These instructions are for maintainers of the project.
develop
branch: Runbash scripts/pre.sh
to ensure everything is in order.develop
branch: Bump the version inpyproject.toml
, following semantic versioning principles. Also modify thelast_unstable_release
andlast_stable_release
in the[tool.changeguard-project-metadata]
table as appropriate.develop
branch: Commit these changes with a message like "Prepare release X.Y.Z". (See the contributions section above).master
branch: Merge thedevelop
branch into themaster
branch:git checkout master && git merge develop --no-ff
.master
branch: Tag the release: Create a git tag for the release withgit tag -a vX.Y.Z -m "Version X.Y.Z"
.- Publish to PyPI: Publish the release to PyPI with
bash scripts/deploy-to-pypi.sh
. - Push to GitHub: Push the commit and tags to GitHub with
git push
andgit push --tags
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
changeguard-0.1.0.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for changeguard-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7563eb90579735878201175bef26a527bc495003017ed6d6f7db24b5bda25d74 |
|
MD5 | 5d28b9352b428124cb292274d94f9f54 |
|
BLAKE2b-256 | 8196b34bd1aa8134cbdb6cef67828d34f1c4ed6d4e88944d5b4a9abb07492221 |