gitgatekeeper 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gitgatekeeper-0.1.1/CHANGELOG.md +43 -0
- gitgatekeeper-0.1.1/CODE_OF_CONDUCT.md +29 -0
- gitgatekeeper-0.1.1/CONTRIBUTING.md +63 -0
- gitgatekeeper-0.1.1/LICENSE +21 -0
- gitgatekeeper-0.1.1/MANIFEST.in +5 -0
- gitgatekeeper-0.1.1/PKG-INFO +671 -0
- gitgatekeeper-0.1.1/README.md +636 -0
- gitgatekeeper-0.1.1/SECURITY.md +41 -0
- gitgatekeeper-0.1.1/config/projects.example.yaml +48 -0
- gitgatekeeper-0.1.1/config/projects.yaml +11 -0
- gitgatekeeper-0.1.1/deploy/systemd/gitgatekeeper.service +34 -0
- gitgatekeeper-0.1.1/pyproject.toml +64 -0
- gitgatekeeper-0.1.1/setup.cfg +4 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/__init__.py +10 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/cli/main.py +1074 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/config/__init__.py +18 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/config/loader.py +100 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/config/models.py +205 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/__init__.py +46 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/buffer.py +125 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/commit_engine.py +900 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/detector.py +154 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/discovery.py +172 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/doctor.py +220 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/events.py +89 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/filters.py +79 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/grouping.py +139 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/inactivity.py +154 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/instance.py +202 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/locking.py +85 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/migrate.py +134 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/monitor.py +408 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/project_manager.py +141 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/push_engine.py +441 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/service.py +703 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/systemd.py +223 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/core/undo.py +104 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/__init__.py +43 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/analyzer.py +96 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/diff.py +252 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/ignore.py +36 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/models.py +118 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/repository.py +123 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/secrets.py +150 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/sensitive.py +114 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/git/status_parser.py +134 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/intelligence/__init__.py +23 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/intelligence/analysis.py +358 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/intelligence/context.py +57 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/intelligence/message.py +117 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/intelligence/profile.py +213 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/intelligence/provider.py +65 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/intelligence/rules.py +561 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/logging_setup.py +122 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/storage/__init__.py +16 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/storage/database.py +235 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/storage/history.py +440 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/storage/models.py +78 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper/storage/recorder.py +178 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper.egg-info/PKG-INFO +671 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper.egg-info/SOURCES.txt +112 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper.egg-info/dependency_links.txt +1 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper.egg-info/entry_points.txt +2 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper.egg-info/requires.txt +14 -0
- gitgatekeeper-0.1.1/src/gitgatekeeper.egg-info/top_level.txt +1 -0
- gitgatekeeper-0.1.1/tests/__init__.py +0 -0
- gitgatekeeper-0.1.1/tests/conftest.py +47 -0
- gitgatekeeper-0.1.1/tests/diff_helpers.py +68 -0
- gitgatekeeper-0.1.1/tests/test_analysis.py +195 -0
- gitgatekeeper-0.1.1/tests/test_analyzer.py +435 -0
- gitgatekeeper-0.1.1/tests/test_approval.py +753 -0
- gitgatekeeper-0.1.1/tests/test_buffer.py +116 -0
- gitgatekeeper-0.1.1/tests/test_cli.py +87 -0
- gitgatekeeper-0.1.1/tests/test_cli_service.py +521 -0
- gitgatekeeper-0.1.1/tests/test_commit_engine.py +919 -0
- gitgatekeeper-0.1.1/tests/test_community.py +169 -0
- gitgatekeeper-0.1.1/tests/test_config.py +177 -0
- gitgatekeeper-0.1.1/tests/test_context.py +257 -0
- gitgatekeeper-0.1.1/tests/test_daily_commit.py +268 -0
- gitgatekeeper-0.1.1/tests/test_database.py +265 -0
- gitgatekeeper-0.1.1/tests/test_detector.py +246 -0
- gitgatekeeper-0.1.1/tests/test_diff.py +286 -0
- gitgatekeeper-0.1.1/tests/test_docs.py +143 -0
- gitgatekeeper-0.1.1/tests/test_doctor_retry.py +287 -0
- gitgatekeeper-0.1.1/tests/test_filters.py +113 -0
- gitgatekeeper-0.1.1/tests/test_grouping.py +171 -0
- gitgatekeeper-0.1.1/tests/test_history.py +229 -0
- gitgatekeeper-0.1.1/tests/test_ignore.py +72 -0
- gitgatekeeper-0.1.1/tests/test_inactivity.py +211 -0
- gitgatekeeper-0.1.1/tests/test_init_service.py +500 -0
- gitgatekeeper-0.1.1/tests/test_instance.py +251 -0
- gitgatekeeper-0.1.1/tests/test_local_only.py +113 -0
- gitgatekeeper-0.1.1/tests/test_locking.py +144 -0
- gitgatekeeper-0.1.1/tests/test_logging_setup.py +158 -0
- gitgatekeeper-0.1.1/tests/test_message.py +77 -0
- gitgatekeeper-0.1.1/tests/test_message_flow.py +75 -0
- gitgatekeeper-0.1.1/tests/test_migrate.py +183 -0
- gitgatekeeper-0.1.1/tests/test_monitor.py +323 -0
- gitgatekeeper-0.1.1/tests/test_packaging.py +164 -0
- gitgatekeeper-0.1.1/tests/test_profile.py +206 -0
- gitgatekeeper-0.1.1/tests/test_project_manager.py +166 -0
- gitgatekeeper-0.1.1/tests/test_provider.py +92 -0
- gitgatekeeper-0.1.1/tests/test_push_engine.py +648 -0
- gitgatekeeper-0.1.1/tests/test_recorder.py +303 -0
- gitgatekeeper-0.1.1/tests/test_reload.py +536 -0
- gitgatekeeper-0.1.1/tests/test_repository.py +55 -0
- gitgatekeeper-0.1.1/tests/test_rules.py +372 -0
- gitgatekeeper-0.1.1/tests/test_secrets.py +160 -0
- gitgatekeeper-0.1.1/tests/test_sensitive.py +86 -0
- gitgatekeeper-0.1.1/tests/test_service.py +504 -0
- gitgatekeeper-0.1.1/tests/test_smart_rules.py +411 -0
- gitgatekeeper-0.1.1/tests/test_stage12.py +420 -0
- gitgatekeeper-0.1.1/tests/test_status_parser.py +153 -0
- gitgatekeeper-0.1.1/tests/test_undo.py +336 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes are listed here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.1] - not yet released
|
|
10
|
+
|
|
11
|
+
First version published on PyPI (`pipx install gitgatekeeper`).
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Releases are uploaded to PyPI by a workflow that uses Trusted Publishing, with
|
|
16
|
+
no token or secret, after the maintainer approves it.
|
|
17
|
+
- The README links to files with absolute addresses, so they work on PyPI too.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- A timing-dependent test could fail on a slow machine.
|
|
22
|
+
|
|
23
|
+
## [0.1.0] - 2026-12-01
|
|
24
|
+
|
|
25
|
+
First public version. Formerly developed under the name GitPilot.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- A service that watches your repositories, waits for inactivity and commits
|
|
30
|
+
with specific Conventional Commit messages written by rules, entirely locally.
|
|
31
|
+
- One cycle can be split into several commits by module, with a file limit.
|
|
32
|
+
- Safety model: protected branches (never committed or pushed), secret scan,
|
|
33
|
+
conflict-marker guard, no force-push, merge or pull, push only to the upstream.
|
|
34
|
+
- Optional push of what it committed, with retries after network failures.
|
|
35
|
+
- A daily commit at a fixed time.
|
|
36
|
+
- Approval queue: `pending`, `approve`, `reject` for projects that require it.
|
|
37
|
+
- `reload` applies a changed configuration without a restart.
|
|
38
|
+
- `init` finds repositories and registers the ones you pick.
|
|
39
|
+
- `service install | uninstall | status` runs it as a systemd user service.
|
|
40
|
+
- `undo` takes back the last commit of a project, keeping every file.
|
|
41
|
+
- `migrate` copies settings and history from the old GitPilot name.
|
|
42
|
+
- `check`, `profile`, `status`, `history`, `logs` for inspection.
|
|
43
|
+
- CI on Python 3.12 and 3.13, with a package build checked by `twine`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Code of conduct
|
|
2
|
+
|
|
3
|
+
We want GitGatekeeper to be a place where people can ask questions, report bugs
|
|
4
|
+
and propose changes without being treated badly.
|
|
5
|
+
|
|
6
|
+
## Expected
|
|
7
|
+
|
|
8
|
+
- Be respectful and assume good faith, including with beginners.
|
|
9
|
+
- Disagree about code and ideas, not about people.
|
|
10
|
+
- Give specific, kind feedback and accept it the same way.
|
|
11
|
+
- Keep to the topic of the project in issues and pull requests.
|
|
12
|
+
|
|
13
|
+
## Not acceptable
|
|
14
|
+
|
|
15
|
+
- Harassment, insults, threats or discriminatory language or jokes.
|
|
16
|
+
- Personal attacks, or publishing someone's private information.
|
|
17
|
+
- Repeated off-topic, promotional or bad-faith comments.
|
|
18
|
+
|
|
19
|
+
## Enforcement
|
|
20
|
+
|
|
21
|
+
The maintainer may edit, hide or delete comments, close or lock threads, and
|
|
22
|
+
block people who break these rules. To report a problem, use GitHub's
|
|
23
|
+
**Report content** option on the comment, or open a private security advisory
|
|
24
|
+
on the repository and describe what happened. Reports are handled with
|
|
25
|
+
discretion.
|
|
26
|
+
|
|
27
|
+
This text is short on purpose. The spirit is that of the
|
|
28
|
+
[Contributor Covenant](https://www.contributor-covenant.org/), which you are
|
|
29
|
+
welcome to read for more detail.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Contributing to GitGatekeeper
|
|
2
|
+
|
|
3
|
+
Thanks for helping. This is a small project with a few firm rules, because the
|
|
4
|
+
tool works inside people's repositories.
|
|
5
|
+
|
|
6
|
+
## Principles that do not bend
|
|
7
|
+
|
|
8
|
+
1. **Local only.** No telemetry, no network calls, no cloud service. The only
|
|
9
|
+
things that may talk to a remote are the push engine (`git push`) and
|
|
10
|
+
`gitgatekeeper check` (`git ls-remote`, read-only). A test enforces this.
|
|
11
|
+
2. **Never lose work.** No force-push, merge, pull, `reset --hard`, `clean` or
|
|
12
|
+
checkout over modified files. `undo` uses `reset --mixed` and only for a
|
|
13
|
+
commit that was never pushed.
|
|
14
|
+
3. **Protected branches stay untouched**, and a push goes only to the upstream of
|
|
15
|
+
the current branch.
|
|
16
|
+
4. **Nothing sensitive leaks:** secrets are scanned before committing, and
|
|
17
|
+
credentials are masked wherever they could be printed.
|
|
18
|
+
5. **Few dependencies.** Runtime dependencies are `watchdog`, `pydantic`, `pyyaml`,
|
|
19
|
+
`typer` and `rich`; adding one needs a strong reason.
|
|
20
|
+
|
|
21
|
+
A change that weakens any of these will not be accepted without a test proving
|
|
22
|
+
the new behaviour is safe.
|
|
23
|
+
|
|
24
|
+
## Setting up
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git clone https://github.com/robertofilho0/GitGatekeeper.git
|
|
28
|
+
cd GitGatekeeper
|
|
29
|
+
python3 -m venv .venv && source .venv/bin/activate
|
|
30
|
+
pip install -e ".[dev]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Python 3.12 or newer. Linux is the supported platform for now.
|
|
34
|
+
|
|
35
|
+
## Before you open a pull request
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
ruff check .
|
|
39
|
+
ruff format --check . # `ruff format .` fixes it
|
|
40
|
+
pytest -q
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
All three must pass; CI runs them on Python 3.12 and 3.13.
|
|
44
|
+
|
|
45
|
+
- **Add tests with your change.** Anything that touches Git must run on a
|
|
46
|
+
temporary repository (see `tests/conftest.py`); tests never touch your real
|
|
47
|
+
repositories or state.
|
|
48
|
+
- A new safety rule should come with a test that fails without it.
|
|
49
|
+
- Document user-visible changes in the README, and add a line to
|
|
50
|
+
[CHANGELOG.md](CHANGELOG.md) under *Unreleased*.
|
|
51
|
+
- Use [Conventional Commits](https://www.conventionalcommits.org/) for messages
|
|
52
|
+
(`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `build:`).
|
|
53
|
+
- Keep pull requests focused: one idea per PR is easier to review and to revert.
|
|
54
|
+
|
|
55
|
+
## Reporting bugs and asking for features
|
|
56
|
+
|
|
57
|
+
Use the issue templates. For anything security related, follow
|
|
58
|
+
[SECURITY.md](SECURITY.md) instead of opening a public issue.
|
|
59
|
+
|
|
60
|
+
## Code of conduct
|
|
61
|
+
|
|
62
|
+
Everyone taking part is expected to follow the
|
|
63
|
+
[Code of Conduct](CODE_OF_CONDUCT.md).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 robertofilho0
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|