docs: Add project structure map for contributors - #1020
thecloudsavvy wants to merge 2 commits into
Conversation
Signed-off-by: Taiwo Abatan <thecloudsavvy@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe README now links to a new project structure guide. The guide documents repository paths, shell and Python hooks, contribution references, and local development checks. ChangesProject structure documentation
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Merge Risk: ⚪ Minimal · up to The documentation links and repository guidance are consistent, with no executable behavior changed. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Taiwo Abatan <thecloudsavvy@gmail.com>
MaxymVlasov
left a comment
There was a problem hiding this comment.
Great start!
I left a few comments to clarify how to make these docs even better
| | --- | --- | | ||
| | `hooks/` | Bash entry points (`<hook_name>.sh`) and shared `_common.sh` | | ||
| | `src/pre_commit_terraform/` | Python package: CLI parsing, env expansion, `__GIT_WORKING_DIR__`, `terraform_docs_replace` | | ||
| | `tests/pytest/` | Python unit tests (`pytest`) | |
There was a problem hiding this comment.
It may make sense to specify that we use pytest also as black-box testing for shell hooks functionality
| | `src/pre_commit_terraform/` | Python package: CLI parsing, env expansion, `__GIT_WORKING_DIR__`, `terraform_docs_replace` | | ||
| | `tests/pytest/` | Python unit tests (`pytest`) | | ||
| | `tools/entrypoint.sh` | Docker image entrypoint | | ||
| | `tools/install/` | Per-tool install scripts used when building the Docker image | |
There was a problem hiding this comment.
It is also used in the recently added --hooks-config=--tool-version=X.Y.Z functionality.
https://github.com/antonbabenko/pre-commit-terraform#most-hooks-pin-a-specific-tool-version
#1002
|
|
||
| | Path | Role | | ||
| | --- | --- | | ||
| | `hooks/` | Bash entry points (`<hook_name>.sh`) and shared `_common.sh` | |
There was a problem hiding this comment.
| | `hooks/` | Bash entry points (`<hook_name>.sh`) and shared `_common.sh` | | |
| | `hooks/` | Bash hooks entry points (`<hook_name>.sh`). Shared internal files starts from the undersore, e.g. `_common.sh` | |
| | `tests/pytest/` | Python unit tests (`pytest`) | | ||
| | `tools/entrypoint.sh` | Docker image entrypoint | | ||
| | `tools/install/` | Per-tool install scripts used when building the Docker image | | ||
| | `dependencies/lock-files/` | Pinned Python constraints for reproducible image builds | |
There was a problem hiding this comment.
Hmm, not sure that we need to document this 🤔
You know what - let's split this table in a few:
- Bash-related
- Python-related
- Used by both & other
There may be more tables. Some entities may appear in multiple tables as well.
I, as contributor, would be like to understand what to touch and what to not during work with some part of project. So would be nice to decompose this table into a few groups.
| | `tools/entrypoint.sh` | Docker image entrypoint | | ||
| | `tools/install/` | Per-tool install scripts used when building the Docker image | | ||
| | `dependencies/lock-files/` | Pinned Python constraints for reproducible image builds | | ||
| | `.pre-commit-hooks.yaml` | Hook definitions consumed by the [pre-commit framework](https://pre-commit.com/) | |
There was a problem hiding this comment.
Let's mention here https://prek.j178.dev/ as well
|
|
||
| ## Hook types | ||
|
|
||
| **Shell hooks** (most of them) live in `hooks/<hook_name>.sh`: |
There was a problem hiding this comment.
| **Shell hooks** (most of them) live in `hooks/<hook_name>.sh`: | |
| **Shell hooks** live in `hooks/<hook_name>.sh`: |
|
|
||
| ## Local checks | ||
|
|
||
| Install pre-commit and run the repo's own hooks before you push. Python tests run with `tox`. Do not hand-edit `CHANGELOG.md`; releases own that file. |
There was a problem hiding this comment.
| Install pre-commit and run the repo's own hooks before you push. Python tests run with `tox`. Do not hand-edit `CHANGELOG.md`; releases own that file. | |
| Install pre-commit and run the repo's own hooks before you push. Python tests run with `tox -qq`. Do not hand-edit `CHANGELOG.md`; releases own that file. |
Summary
First slice of #865: a contributor-facing project structure page (layout, shell vs Python hooks, tests) and README links. Hook usage stays in the README; PR process stays in
.github/CONTRIBUTING.md.