shipgate 0.0.2__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.
Files changed (188) hide show
  1. shipgate-0.0.2/LICENSE +21 -0
  2. shipgate-0.0.2/PKG-INFO +307 -0
  3. shipgate-0.0.2/README.md +272 -0
  4. shipgate-0.0.2/pyproject.toml +142 -0
  5. shipgate-0.0.2/setup.cfg +4 -0
  6. shipgate-0.0.2/src/shipgate/__init__.py +6 -0
  7. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/bandit.scan.yaml +13 -0
  8. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/codespell.spelling.yaml +12 -0
  9. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/deadcode.scan.yaml +13 -0
  10. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/gate.acronym-allowlist.yaml +14 -0
  11. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/gate.folder-breadth.yaml +14 -0
  12. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/gate.module-private-vars.yaml +14 -0
  13. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/gate.module-size.yaml +14 -0
  14. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/gitleaks.secrets.yaml +21 -0
  15. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/hadolint.dockerfile.yaml +16 -0
  16. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/jscpd.duplication.yaml +19 -0
  17. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/markdownlint.check.yaml +17 -0
  18. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/mdformat.apply.yaml +10 -0
  19. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/mdformat.format.yaml +14 -0
  20. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/mutmut.run.yaml +13 -0
  21. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/pydeps.cycles.yaml +14 -0
  22. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/pytest.coverage.yaml +19 -0
  23. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/pytest.test.yaml +14 -0
  24. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/radon.cc.yaml +13 -0
  25. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/radon.mi.yaml +13 -0
  26. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/ruff.format.apply.yaml +11 -0
  27. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/ruff.format.yaml +14 -0
  28. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/ruff.lint.yaml +15 -0
  29. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/ruff.unused.yaml +17 -0
  30. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/semgrep.scan.yaml +28 -0
  31. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/shellcheck.check.yaml +15 -0
  32. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/shfmt.apply.yaml +11 -0
  33. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/shfmt.format.yaml +14 -0
  34. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/sourcery.review.yaml +14 -0
  35. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/ty.check.yaml +15 -0
  36. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/vulture.scan.yaml +16 -0
  37. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/yamlfmt.apply.yaml +10 -0
  38. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/yamlfmt.format.yaml +14 -0
  39. shipgate-0.0.2/src/shipgate/bundle/catalog/checks/yamllint.check.yaml +16 -0
  40. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/bandit.yaml +20 -0
  41. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/codespell.yaml +17 -0
  42. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/deadcode.yaml +13 -0
  43. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/gitleaks.yaml +13 -0
  44. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/hadolint.yaml +15 -0
  45. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/jscpd.yaml +15 -0
  46. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/markdownlint.yaml +18 -0
  47. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/mdformat.yaml +13 -0
  48. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/mutmut.yaml +10 -0
  49. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/pydeps.yaml +10 -0
  50. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/pytest.yaml +17 -0
  51. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/radon.yaml +10 -0
  52. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/ruff.yaml +26 -0
  53. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/script.yaml +8 -0
  54. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/semgrep.yaml +21 -0
  55. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/shellcheck.yaml +10 -0
  56. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/shfmt.yaml +13 -0
  57. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/sourcery.yaml +10 -0
  58. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/ty.yaml +20 -0
  59. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/vulture.yaml +13 -0
  60. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/yamlfmt.yaml +24 -0
  61. shipgate-0.0.2/src/shipgate/bundle/catalog/tools/yamllint.yaml +24 -0
  62. shipgate-0.0.2/src/shipgate/bundle/defaults/allowlists/acronyms.yaml +10 -0
  63. shipgate-0.0.2/src/shipgate/bundle/defaults/allowlists/folder-breadth.txt +1 -0
  64. shipgate-0.0.2/src/shipgate/bundle/defaults/allowlists/module-private-vars.txt +1 -0
  65. shipgate-0.0.2/src/shipgate/bundle/defaults/allowlists/module-size.txt +1 -0
  66. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/bandit.yaml +5 -0
  67. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/gates/acronym-allowlist.yaml +4 -0
  68. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/gates/folder-breadth.yaml +12 -0
  69. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/gates/module-private-vars.yaml +4 -0
  70. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/gates/module-size.yaml +6 -0
  71. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/markdownlint.json +8 -0
  72. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/ruff.toml +11 -0
  73. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/ty.toml +5 -0
  74. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/yamlfmt.yaml +4 -0
  75. shipgate-0.0.2/src/shipgate/bundle/defaults/configs/yamllint.yaml +12 -0
  76. shipgate-0.0.2/src/shipgate/bundle/defaults/gates/README.md +150 -0
  77. shipgate-0.0.2/src/shipgate/bundle/defaults/gates/acronym-allowlist.sh +15 -0
  78. shipgate-0.0.2/src/shipgate/bundle/defaults/gates/folder-breadth.sh +22 -0
  79. shipgate-0.0.2/src/shipgate/bundle/defaults/gates/lib.sh +116 -0
  80. shipgate-0.0.2/src/shipgate/bundle/defaults/gates/module-private-vars.sh +77 -0
  81. shipgate-0.0.2/src/shipgate/bundle/defaults/gates/module-size.sh +60 -0
  82. shipgate-0.0.2/src/shipgate/bundle/defaults/semgrep/python-quality.yml +20 -0
  83. shipgate-0.0.2/src/shipgate/bundle/suites/all-lint.yaml +44 -0
  84. shipgate-0.0.2/src/shipgate/bundle/suites/all.yaml +51 -0
  85. shipgate-0.0.2/src/shipgate/bundle/suites/demo.yaml +11 -0
  86. shipgate-0.0.2/src/shipgate/bundle/suites/extended.yaml +34 -0
  87. shipgate-0.0.2/src/shipgate/bundle/suites/format.yaml +10 -0
  88. shipgate-0.0.2/src/shipgate/bundle/suites/formatting.yaml +10 -0
  89. shipgate-0.0.2/src/shipgate/bundle/suites/policy.yaml +11 -0
  90. shipgate-0.0.2/src/shipgate/bundle/suites/python-quality.yaml +18 -0
  91. shipgate-0.0.2/src/shipgate/bundle/suites/reslab-parity.yaml +41 -0
  92. shipgate-0.0.2/src/shipgate/bundle/suites/standard.yaml +45 -0
  93. shipgate-0.0.2/src/shipgate/cli.py +356 -0
  94. shipgate-0.0.2/src/shipgate/cli_aliases.py +76 -0
  95. shipgate-0.0.2/src/shipgate/config_resolver.py +179 -0
  96. shipgate-0.0.2/src/shipgate/constants.py +21 -0
  97. shipgate-0.0.2/src/shipgate/discovery.py +62 -0
  98. shipgate-0.0.2/src/shipgate/error_formatters.py +260 -0
  99. shipgate-0.0.2/src/shipgate/gate_config.py +137 -0
  100. shipgate-0.0.2/src/shipgate/gate_sdk.py +75 -0
  101. shipgate-0.0.2/src/shipgate/gates.py +133 -0
  102. shipgate-0.0.2/src/shipgate/ignore.py +280 -0
  103. shipgate-0.0.2/src/shipgate/ignore_materialize.py +210 -0
  104. shipgate-0.0.2/src/shipgate/installer.py +122 -0
  105. shipgate-0.0.2/src/shipgate/models.py +314 -0
  106. shipgate-0.0.2/src/shipgate/overrides.py +18 -0
  107. shipgate-0.0.2/src/shipgate/parsers/__init__.py +76 -0
  108. shipgate-0.0.2/src/shipgate/parsers/analysis.py +422 -0
  109. shipgate-0.0.2/src/shipgate/parsers/base.py +29 -0
  110. shipgate-0.0.2/src/shipgate/parsers/common.py +57 -0
  111. shipgate-0.0.2/src/shipgate/parsers/format_text.py +118 -0
  112. shipgate-0.0.2/src/shipgate/parsers/gates.py +92 -0
  113. shipgate-0.0.2/src/shipgate/parsers/patterns.py +78 -0
  114. shipgate-0.0.2/src/shipgate/parsers/prose.py +235 -0
  115. shipgate-0.0.2/src/shipgate/parsers/ruff.py +103 -0
  116. shipgate-0.0.2/src/shipgate/parsers/shell.py +83 -0
  117. shipgate-0.0.2/src/shipgate/paths.py +36 -0
  118. shipgate-0.0.2/src/shipgate/policy/__init__.py +0 -0
  119. shipgate-0.0.2/src/shipgate/policy/acronym_allowlist.py +322 -0
  120. shipgate-0.0.2/src/shipgate/policy/folder_breadth.py +306 -0
  121. shipgate-0.0.2/src/shipgate/registry.py +117 -0
  122. shipgate-0.0.2/src/shipgate/reporter.py +87 -0
  123. shipgate-0.0.2/src/shipgate/resolver.py +199 -0
  124. shipgate-0.0.2/src/shipgate/runner.py +601 -0
  125. shipgate-0.0.2/src/shipgate/runner_script.py +144 -0
  126. shipgate-0.0.2/src/shipgate/server/__init__.py +1 -0
  127. shipgate-0.0.2/src/shipgate/server/app.py +424 -0
  128. shipgate-0.0.2/src/shipgate/server/cli.py +20 -0
  129. shipgate-0.0.2/src/shipgate/server/finding_context.py +101 -0
  130. shipgate-0.0.2/src/shipgate/server/ingest.py +186 -0
  131. shipgate-0.0.2/src/shipgate/server/models.py +60 -0
  132. shipgate-0.0.2/src/shipgate/server/orchestrator.py +188 -0
  133. shipgate-0.0.2/src/shipgate/server/requirements.py +23 -0
  134. shipgate-0.0.2/src/shipgate/server/static/css/app.css +66 -0
  135. shipgate-0.0.2/src/shipgate/server/static/js/app.js +50 -0
  136. shipgate-0.0.2/src/shipgate/server/storage/__init__.py +6 -0
  137. shipgate-0.0.2/src/shipgate/server/storage/base.py +59 -0
  138. shipgate-0.0.2/src/shipgate/server/storage/sqlite.py +441 -0
  139. shipgate-0.0.2/src/shipgate/server/templates/base.html +71 -0
  140. shipgate-0.0.2/src/shipgate/server/templates/findings.html +183 -0
  141. shipgate-0.0.2/src/shipgate/server/templates/new_run.html +65 -0
  142. shipgate-0.0.2/src/shipgate/server/templates/overview.html +189 -0
  143. shipgate-0.0.2/src/shipgate/server/templates/partials/run_progress.html +16 -0
  144. shipgate-0.0.2/src/shipgate/server/templates/partials/snippet.html +15 -0
  145. shipgate-0.0.2/src/shipgate/server/templates/runs.html +55 -0
  146. shipgate-0.0.2/src/shipgate/server/templates/tools.html +50 -0
  147. shipgate-0.0.2/src/shipgate/server/tool_versions.py +193 -0
  148. shipgate-0.0.2/src/shipgate/server/worktree.py +126 -0
  149. shipgate-0.0.2/src/shipgate/target_expand.py +136 -0
  150. shipgate-0.0.2/src/shipgate/tool_scaffold.py +85 -0
  151. shipgate-0.0.2/src/shipgate.egg-info/PKG-INFO +307 -0
  152. shipgate-0.0.2/src/shipgate.egg-info/SOURCES.txt +186 -0
  153. shipgate-0.0.2/src/shipgate.egg-info/dependency_links.txt +1 -0
  154. shipgate-0.0.2/src/shipgate.egg-info/entry_points.txt +2 -0
  155. shipgate-0.0.2/src/shipgate.egg-info/requires.txt +10 -0
  156. shipgate-0.0.2/src/shipgate.egg-info/top_level.txt +1 -0
  157. shipgate-0.0.2/tests/test_all_lint_suite.py +38 -0
  158. shipgate-0.0.2/tests/test_check_modes.py +45 -0
  159. shipgate-0.0.2/tests/test_cli.py +49 -0
  160. shipgate-0.0.2/tests/test_cli_extended.py +161 -0
  161. shipgate-0.0.2/tests/test_config_and_targets.py +244 -0
  162. shipgate-0.0.2/tests/test_discovery.py +94 -0
  163. shipgate-0.0.2/tests/test_error_formatters.py +117 -0
  164. shipgate-0.0.2/tests/test_finding_context.py +83 -0
  165. shipgate-0.0.2/tests/test_format_shell_parsers.py +53 -0
  166. shipgate-0.0.2/tests/test_gate_config.py +45 -0
  167. shipgate-0.0.2/tests/test_gate_sdk.py +34 -0
  168. shipgate-0.0.2/tests/test_ignore.py +186 -0
  169. shipgate-0.0.2/tests/test_mdformat_parser.py +21 -0
  170. shipgate-0.0.2/tests/test_mutmut_pydeps_parsers.py +69 -0
  171. shipgate-0.0.2/tests/test_npm_install.py +53 -0
  172. shipgate-0.0.2/tests/test_packaging.py +35 -0
  173. shipgate-0.0.2/tests/test_parser_registry.py +124 -0
  174. shipgate-0.0.2/tests/test_path_and_parser_fixes.py +90 -0
  175. shipgate-0.0.2/tests/test_project_env_launch.py +174 -0
  176. shipgate-0.0.2/tests/test_quality_coverage_boost.py +218 -0
  177. shipgate-0.0.2/tests/test_ruff_format_parser.py +16 -0
  178. shipgate-0.0.2/tests/test_script_gates.py +56 -0
  179. shipgate-0.0.2/tests/test_server_app.py +507 -0
  180. shipgate-0.0.2/tests/test_server_cli.py +14 -0
  181. shipgate-0.0.2/tests/test_server_ingest.py +207 -0
  182. shipgate-0.0.2/tests/test_server_orchestrator.py +132 -0
  183. shipgate-0.0.2/tests/test_server_packaging.py +5 -0
  184. shipgate-0.0.2/tests/test_server_storage.py +91 -0
  185. shipgate-0.0.2/tests/test_server_worktree.py +140 -0
  186. shipgate-0.0.2/tests/test_tool_versions.py +78 -0
  187. shipgate-0.0.2/tests/test_tools_root.py +129 -0
  188. shipgate-0.0.2/tests/test_wheel_install.py +51 -0
shipgate-0.0.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vishal Kumar Mishra
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.
@@ -0,0 +1,307 @@
1
+ Metadata-Version: 2.4
2
+ Name: shipgate
3
+ Version: 0.0.2
4
+ Summary: Quality-gate orchestrator for AI-assisted development
5
+ Author-email: Vishal Kumar Mishra <vishal.k.mishra2@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Changelog, https://github.com/inquilabee/shipgate/blob/main/CHANGELOG.md
8
+ Project-URL: Homepage, https://github.com/inquilabee/shipgate
9
+ Project-URL: Issues, https://github.com/inquilabee/shipgate/issues
10
+ Project-URL: Repository, https://github.com/inquilabee/shipgate
11
+ Keywords: shipgate,quality,lint,format,pre-commit,python,static-analysis
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Requires-Python: <3.15,>=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: pydantic>=2.0
26
+ Requires-Dist: pathspec>=0.12
27
+ Requires-Dist: pyyaml>=6.0
28
+ Requires-Dist: typer>=0.12
29
+ Provides-Extra: server
30
+ Requires-Dist: fastapi>=0.115; extra == "server"
31
+ Requires-Dist: jinja2>=3.1; extra == "server"
32
+ Requires-Dist: uvicorn>=0.30; extra == "server"
33
+ Requires-Dist: python-multipart>=0.0.9; extra == "server"
34
+ Dynamic: license-file
35
+
36
+ # shipgate
37
+
38
+ Quality gates for Python repos that developers can run locally, in CI, or hand to an AI agent without inventing a new workflow each time.
39
+
40
+ `shipgate` gives you one project config, a bundled catalog of checks, quiet success, and structured failure reports. It is inspired by Trunk and pre-commit, but keeps the surface area small:
41
+
42
+ ```bash
43
+ shipgate install
44
+ shipgate format
45
+ shipgate check
46
+ ```
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ pip install shipgate
52
+ # or
53
+ uv add --dev shipgate
54
+ ```
55
+
56
+ Requires Python 3.11–3.14.
57
+
58
+ ## 60-Second Setup
59
+
60
+ Create `shipgate.yaml`:
61
+
62
+ ```yaml
63
+ suite: standard
64
+ env: managed
65
+ target: .
66
+ error-format: compact
67
+ configs:
68
+ mode: auto
69
+ ```
70
+
71
+ Then run:
72
+
73
+ ```bash
74
+ shipgate install # install tools needed by suite
75
+ shipgate format # apply formatter/autofix checks
76
+ shipgate check # report-only quality checks
77
+ ```
78
+
79
+ shipgate always respects `.gitignore`; bundled defaults also skip `.venv/`, `.shipgate/`, and `reports/` even when your suite YAML does not list them.
80
+
81
+ The `suite:` value is the project default. You do not need to repeat `--suite standard`; the CLI reads it from `shipgate.yaml`.
82
+
83
+ Success is silent and exits `0`. Failures exit `1`, write a JSON report under `reports/failures/`, and print the same report through your configured `error-format`.
84
+
85
+ ## Mental Model
86
+
87
+ - **Suite**: a named checklist, such as `python-quality`, `standard`, or `all`.
88
+ - **Check**: one rule runner inside a suite, such as `ruff.lint` or `ty.check`.
89
+ - **`check`**: report-only. It should not rewrite your files.
90
+ - **`format`**: applies write/fix checks, such as formatters.
91
+ - **`install`**: installs the tools needed by the selected suite.
92
+
93
+ Most teams pick a suite once in `shipgate.yaml` and run the same three commands everywhere.
94
+
95
+ ## Config That Matters
96
+
97
+ ```yaml
98
+ suite: python-quality # default checklist for install/check/format
99
+ env: managed # managed tools under .shipgate/tools
100
+ target: . # scan root; defaults to .
101
+ error-format: compact # json | log | text | compact | github
102
+
103
+ configs:
104
+ mode: auto # repo configs first, bundled fallback
105
+ ```
106
+
107
+ Use `--suite` only when you want a one-off override:
108
+
109
+ ```bash
110
+ shipgate check --suite extended
111
+ shipgate install --suite standard
112
+ ```
113
+
114
+ Copy [`shipgate.yaml.example`](shipgate.yaml.example) for an annotated config with ignores, custom checks, gates, and custom error formatters.
115
+
116
+ ## Suites
117
+
118
+ Suites are bundled starting points. They choose which checks run; tools still discover their own files and `.gitignore` is always respected.
119
+
120
+ | Suite | Use it for |
121
+ | --- | --- |
122
+ | `all` | Run every bundled check |
123
+ | `all-lint` | Full lint/analysis + tests (no format check or apply) |
124
+ | `python-quality` | Core Python lint, format-check, and type checks |
125
+ | `formatting` | Report-only formatting drift |
126
+ | `format` | Formatter/autofix checks that write files |
127
+ | `standard` | Broader portable quality baseline |
128
+ | `extended` | Slower optional checks on top of standard |
129
+ | `policy` | Bundled script gates |
130
+ | `demo` | Internal/sample fixture suite |
131
+
132
+ Examples:
133
+
134
+ ```yaml
135
+ # Local Python repo
136
+ suite: python-quality
137
+ error-format: text
138
+ ```
139
+
140
+ ```yaml
141
+ # CI baseline with GitHub annotations
142
+ suite: standard
143
+ error-format: github
144
+ ```
145
+
146
+ ```yaml
147
+ # Max coverage while developing shipgate itself
148
+ suite: all
149
+ error-format: compact
150
+ ```
151
+
152
+ ## Error Output
153
+
154
+ On failure, shipgate always writes the canonical JSON report to disk:
155
+
156
+ ```text
157
+ reports/failures/ruff.lint-20260716T163000Z/report.json
158
+ ```
159
+
160
+ `error-format` only controls what is printed to stderr.
161
+
162
+ | Format | Example output |
163
+ | --- | --- |
164
+ | `json` | Pretty JSON report, including `report_path` |
165
+ | `log` | `2026-07-16T12:00:00+00:00 [error] ruff.lint/E501 src/app.py:42: Line too long` |
166
+ | `text` | `- [error] E501: Line too long (src/app.py:42)` |
167
+ | `compact` | `src/app.py:42: error: E501 Line too long` |
168
+ | `github` | `::error file=src/app.py,title=ruff.lint/E501,line=42::Line too long` |
169
+
170
+ Default is `json` when `error-format` is omitted.
171
+
172
+ Custom formatters live in `shipgate.yaml`:
173
+
174
+ ```yaml
175
+ suite: all
176
+ error-format: short
177
+ error-formatters:
178
+ short:
179
+ kind: finding_line
180
+ template: "{severity}\t{rule_id}\t{file}:{line}\t{message}"
181
+ jq-summary:
182
+ kind: jq
183
+ program: >
184
+ .findings[] | "[\(.severity)] \(.rule_id) \(.message)"
185
+ ```
186
+
187
+ `finding_line` placeholders: `severity`, `rule_id`, `message`, `file`, `line`, `check_id`, `report_path`.
188
+
189
+ `jq` formatters require `jq` on `PATH`.
190
+
191
+ ## Daily Commands
192
+
193
+ ```bash
194
+ shipgate install
195
+ shipgate format
196
+ shipgate check
197
+ ```
198
+
199
+ Inspect what is available:
200
+
201
+ ```bash
202
+ shipgate list suites
203
+ shipgate list tools
204
+ shipgate list checks
205
+ ```
206
+
207
+ Run a single check:
208
+
209
+ ```bash
210
+ shipgate check --check ruff.lint --target .
211
+ ```
212
+
213
+ Export the failure report schema:
214
+
215
+ ```bash
216
+ shipgate schema > failure-report.schema.json
217
+ ```
218
+
219
+ ## Report server
220
+
221
+ Browse suite runs and findings in a local web UI:
222
+
223
+ ```bash
224
+ pip install 'shipgate[server]'
225
+ shipgate server
226
+ shipgate server --port 8765 --open
227
+ ```
228
+
229
+ ## Project-Local Gates
230
+
231
+ Use gates when a repo needs a policy that is not covered by the bundled catalog.
232
+
233
+ ```bash
234
+ shipgate gate init module-size --description "Cap module line counts"
235
+ ```
236
+
237
+ That creates a shell gate under `.shipgate/gates/` and a catalog entry under `.shipgate/catalog/checks/`. Enable it from `shipgate.yaml`:
238
+
239
+ ```yaml
240
+ checks:
241
+ - id: gate.module-size
242
+ ```
243
+
244
+ ## CI
245
+
246
+ Minimal GitHub Actions job:
247
+
248
+ ```yaml
249
+ name: quality
250
+
251
+ on:
252
+ pull_request:
253
+ push:
254
+ branches: [main]
255
+
256
+ jobs:
257
+ shipgate:
258
+ runs-on: ubuntu-latest
259
+ steps:
260
+ - uses: actions/checkout@v4
261
+ - uses: astral-sh/setup-uv@v6
262
+ - run: uvx shipgate install
263
+ - run: uvx shipgate check
264
+ ```
265
+
266
+ For GitHub PR annotations, set:
267
+
268
+ ```yaml
269
+ error-format: github
270
+ ```
271
+
272
+ ## Contributing
273
+
274
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for local development, adding tools/checks, and release notes.
275
+
276
+ ## Bundled tools
277
+
278
+ | Tool | Purpose |
279
+ | --- | --- |
280
+ | [Bandit](https://bandit.readthedocs.io/) | Security issue scanner for Python |
281
+ | [codespell](https://github.com/codespell-project/codespell) | Common misspellings in text and code |
282
+ | [deadcode](https://github.com/alanedwardes/deadcode) | Unused Python code via static analysis |
283
+ | [Gitleaks](https://github.com/gitleaks/gitleaks) | Secret scanning for git repositories |
284
+ | [Hadolint](https://github.com/hadolint/hadolint) | Dockerfile linter |
285
+ | [JSCPD](https://docs.jscpd.io/) | Copy/paste / duplication detector |
286
+ | [markdownlint](https://github.com/DavidAnson/markdownlint) | Markdown style linter |
287
+ | [mdformat](https://github.com/executablebooks/mdformat) | Markdown formatter |
288
+ | [mutmut](https://mutmut.readthedocs.io/) | Mutation testing for Python |
289
+ | [pydeps](https://github.com/thebjorn/pydeps) | Python dependency graphs and cycle detection |
290
+ | [pytest](https://docs.pytest.org/) | Test runner (optional coverage via pytest-cov) |
291
+ | [Radon](https://radon.readthedocs.io/) | Cyclomatic complexity and maintainability metrics |
292
+ | [Ruff](https://docs.astral.sh/ruff/) | Fast Python linter and formatter |
293
+ | Script gates | Project-local bash policy checks (`shipgate gate init`) |
294
+ | [Semgrep](https://semgrep.dev/) | Pattern-based security and quality analysis |
295
+ | [ShellCheck](https://www.shellcheck.net/) | Static analysis for shell scripts |
296
+ | [shfmt](https://github.com/mvdan/sh) | Shell script formatter |
297
+ | [Sourcery](https://sourcery.ai/) | Automated Python review / refactor suggestions |
298
+ | [ty](https://docs.astral.sh/ty/) | Astral static type checker for Python |
299
+ | [Vulture](https://github.com/jendrikseipp/vulture) | Dead Python code with high confidence |
300
+ | [yamlfmt](https://github.com/google/yamlfmt) | YAML formatter |
301
+ | [yamllint](https://yamllint.readthedocs.io/) | YAML syntax and style linter |
302
+
303
+ List the live catalog anytime with `shipgate list tools`.
304
+
305
+ ## License
306
+
307
+ MIT
@@ -0,0 +1,272 @@
1
+ # shipgate
2
+
3
+ Quality gates for Python repos that developers can run locally, in CI, or hand to an AI agent without inventing a new workflow each time.
4
+
5
+ `shipgate` gives you one project config, a bundled catalog of checks, quiet success, and structured failure reports. It is inspired by Trunk and pre-commit, but keeps the surface area small:
6
+
7
+ ```bash
8
+ shipgate install
9
+ shipgate format
10
+ shipgate check
11
+ ```
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ pip install shipgate
17
+ # or
18
+ uv add --dev shipgate
19
+ ```
20
+
21
+ Requires Python 3.11–3.14.
22
+
23
+ ## 60-Second Setup
24
+
25
+ Create `shipgate.yaml`:
26
+
27
+ ```yaml
28
+ suite: standard
29
+ env: managed
30
+ target: .
31
+ error-format: compact
32
+ configs:
33
+ mode: auto
34
+ ```
35
+
36
+ Then run:
37
+
38
+ ```bash
39
+ shipgate install # install tools needed by suite
40
+ shipgate format # apply formatter/autofix checks
41
+ shipgate check # report-only quality checks
42
+ ```
43
+
44
+ shipgate always respects `.gitignore`; bundled defaults also skip `.venv/`, `.shipgate/`, and `reports/` even when your suite YAML does not list them.
45
+
46
+ The `suite:` value is the project default. You do not need to repeat `--suite standard`; the CLI reads it from `shipgate.yaml`.
47
+
48
+ Success is silent and exits `0`. Failures exit `1`, write a JSON report under `reports/failures/`, and print the same report through your configured `error-format`.
49
+
50
+ ## Mental Model
51
+
52
+ - **Suite**: a named checklist, such as `python-quality`, `standard`, or `all`.
53
+ - **Check**: one rule runner inside a suite, such as `ruff.lint` or `ty.check`.
54
+ - **`check`**: report-only. It should not rewrite your files.
55
+ - **`format`**: applies write/fix checks, such as formatters.
56
+ - **`install`**: installs the tools needed by the selected suite.
57
+
58
+ Most teams pick a suite once in `shipgate.yaml` and run the same three commands everywhere.
59
+
60
+ ## Config That Matters
61
+
62
+ ```yaml
63
+ suite: python-quality # default checklist for install/check/format
64
+ env: managed # managed tools under .shipgate/tools
65
+ target: . # scan root; defaults to .
66
+ error-format: compact # json | log | text | compact | github
67
+
68
+ configs:
69
+ mode: auto # repo configs first, bundled fallback
70
+ ```
71
+
72
+ Use `--suite` only when you want a one-off override:
73
+
74
+ ```bash
75
+ shipgate check --suite extended
76
+ shipgate install --suite standard
77
+ ```
78
+
79
+ Copy [`shipgate.yaml.example`](shipgate.yaml.example) for an annotated config with ignores, custom checks, gates, and custom error formatters.
80
+
81
+ ## Suites
82
+
83
+ Suites are bundled starting points. They choose which checks run; tools still discover their own files and `.gitignore` is always respected.
84
+
85
+ | Suite | Use it for |
86
+ | --- | --- |
87
+ | `all` | Run every bundled check |
88
+ | `all-lint` | Full lint/analysis + tests (no format check or apply) |
89
+ | `python-quality` | Core Python lint, format-check, and type checks |
90
+ | `formatting` | Report-only formatting drift |
91
+ | `format` | Formatter/autofix checks that write files |
92
+ | `standard` | Broader portable quality baseline |
93
+ | `extended` | Slower optional checks on top of standard |
94
+ | `policy` | Bundled script gates |
95
+ | `demo` | Internal/sample fixture suite |
96
+
97
+ Examples:
98
+
99
+ ```yaml
100
+ # Local Python repo
101
+ suite: python-quality
102
+ error-format: text
103
+ ```
104
+
105
+ ```yaml
106
+ # CI baseline with GitHub annotations
107
+ suite: standard
108
+ error-format: github
109
+ ```
110
+
111
+ ```yaml
112
+ # Max coverage while developing shipgate itself
113
+ suite: all
114
+ error-format: compact
115
+ ```
116
+
117
+ ## Error Output
118
+
119
+ On failure, shipgate always writes the canonical JSON report to disk:
120
+
121
+ ```text
122
+ reports/failures/ruff.lint-20260716T163000Z/report.json
123
+ ```
124
+
125
+ `error-format` only controls what is printed to stderr.
126
+
127
+ | Format | Example output |
128
+ | --- | --- |
129
+ | `json` | Pretty JSON report, including `report_path` |
130
+ | `log` | `2026-07-16T12:00:00+00:00 [error] ruff.lint/E501 src/app.py:42: Line too long` |
131
+ | `text` | `- [error] E501: Line too long (src/app.py:42)` |
132
+ | `compact` | `src/app.py:42: error: E501 Line too long` |
133
+ | `github` | `::error file=src/app.py,title=ruff.lint/E501,line=42::Line too long` |
134
+
135
+ Default is `json` when `error-format` is omitted.
136
+
137
+ Custom formatters live in `shipgate.yaml`:
138
+
139
+ ```yaml
140
+ suite: all
141
+ error-format: short
142
+ error-formatters:
143
+ short:
144
+ kind: finding_line
145
+ template: "{severity}\t{rule_id}\t{file}:{line}\t{message}"
146
+ jq-summary:
147
+ kind: jq
148
+ program: >
149
+ .findings[] | "[\(.severity)] \(.rule_id) \(.message)"
150
+ ```
151
+
152
+ `finding_line` placeholders: `severity`, `rule_id`, `message`, `file`, `line`, `check_id`, `report_path`.
153
+
154
+ `jq` formatters require `jq` on `PATH`.
155
+
156
+ ## Daily Commands
157
+
158
+ ```bash
159
+ shipgate install
160
+ shipgate format
161
+ shipgate check
162
+ ```
163
+
164
+ Inspect what is available:
165
+
166
+ ```bash
167
+ shipgate list suites
168
+ shipgate list tools
169
+ shipgate list checks
170
+ ```
171
+
172
+ Run a single check:
173
+
174
+ ```bash
175
+ shipgate check --check ruff.lint --target .
176
+ ```
177
+
178
+ Export the failure report schema:
179
+
180
+ ```bash
181
+ shipgate schema > failure-report.schema.json
182
+ ```
183
+
184
+ ## Report server
185
+
186
+ Browse suite runs and findings in a local web UI:
187
+
188
+ ```bash
189
+ pip install 'shipgate[server]'
190
+ shipgate server
191
+ shipgate server --port 8765 --open
192
+ ```
193
+
194
+ ## Project-Local Gates
195
+
196
+ Use gates when a repo needs a policy that is not covered by the bundled catalog.
197
+
198
+ ```bash
199
+ shipgate gate init module-size --description "Cap module line counts"
200
+ ```
201
+
202
+ That creates a shell gate under `.shipgate/gates/` and a catalog entry under `.shipgate/catalog/checks/`. Enable it from `shipgate.yaml`:
203
+
204
+ ```yaml
205
+ checks:
206
+ - id: gate.module-size
207
+ ```
208
+
209
+ ## CI
210
+
211
+ Minimal GitHub Actions job:
212
+
213
+ ```yaml
214
+ name: quality
215
+
216
+ on:
217
+ pull_request:
218
+ push:
219
+ branches: [main]
220
+
221
+ jobs:
222
+ shipgate:
223
+ runs-on: ubuntu-latest
224
+ steps:
225
+ - uses: actions/checkout@v4
226
+ - uses: astral-sh/setup-uv@v6
227
+ - run: uvx shipgate install
228
+ - run: uvx shipgate check
229
+ ```
230
+
231
+ For GitHub PR annotations, set:
232
+
233
+ ```yaml
234
+ error-format: github
235
+ ```
236
+
237
+ ## Contributing
238
+
239
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for local development, adding tools/checks, and release notes.
240
+
241
+ ## Bundled tools
242
+
243
+ | Tool | Purpose |
244
+ | --- | --- |
245
+ | [Bandit](https://bandit.readthedocs.io/) | Security issue scanner for Python |
246
+ | [codespell](https://github.com/codespell-project/codespell) | Common misspellings in text and code |
247
+ | [deadcode](https://github.com/alanedwardes/deadcode) | Unused Python code via static analysis |
248
+ | [Gitleaks](https://github.com/gitleaks/gitleaks) | Secret scanning for git repositories |
249
+ | [Hadolint](https://github.com/hadolint/hadolint) | Dockerfile linter |
250
+ | [JSCPD](https://docs.jscpd.io/) | Copy/paste / duplication detector |
251
+ | [markdownlint](https://github.com/DavidAnson/markdownlint) | Markdown style linter |
252
+ | [mdformat](https://github.com/executablebooks/mdformat) | Markdown formatter |
253
+ | [mutmut](https://mutmut.readthedocs.io/) | Mutation testing for Python |
254
+ | [pydeps](https://github.com/thebjorn/pydeps) | Python dependency graphs and cycle detection |
255
+ | [pytest](https://docs.pytest.org/) | Test runner (optional coverage via pytest-cov) |
256
+ | [Radon](https://radon.readthedocs.io/) | Cyclomatic complexity and maintainability metrics |
257
+ | [Ruff](https://docs.astral.sh/ruff/) | Fast Python linter and formatter |
258
+ | Script gates | Project-local bash policy checks (`shipgate gate init`) |
259
+ | [Semgrep](https://semgrep.dev/) | Pattern-based security and quality analysis |
260
+ | [ShellCheck](https://www.shellcheck.net/) | Static analysis for shell scripts |
261
+ | [shfmt](https://github.com/mvdan/sh) | Shell script formatter |
262
+ | [Sourcery](https://sourcery.ai/) | Automated Python review / refactor suggestions |
263
+ | [ty](https://docs.astral.sh/ty/) | Astral static type checker for Python |
264
+ | [Vulture](https://github.com/jendrikseipp/vulture) | Dead Python code with high confidence |
265
+ | [yamlfmt](https://github.com/google/yamlfmt) | YAML formatter |
266
+ | [yamllint](https://yamllint.readthedocs.io/) | YAML syntax and style linter |
267
+
268
+ List the live catalog anytime with `shipgate list tools`.
269
+
270
+ ## License
271
+
272
+ MIT