Describe the preferred setup of green-field projects

This commit is contained in:
Ohad Livne 2026-04-18 11:54:03 +03:00
parent ff76aaf525
commit 2be49fd182
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D

View file

@ -80,3 +80,31 @@ command -v -o file.txt
```
Long options are self-documenting and make scripts and examples easier to understand without consulting help text. Short options are acceptable for interactive use but should not appear in committed code, documentation, or examples.
## Green-Field Project Setup
When setting up a new project, code-quality and developer-experience tooling must be included from the start and integrated into the development workflow. The principles below use Python as a concrete example, but apply generally to any language ecosystem.
### Python Tooling
Use **uv** to manage dependencies and create the project virtual environment. All work must be performed inside the venv. Additionally, install and configure the **pre-commit** hook manager with a baseline DevEx toolset:
- **ruff** — linting and formatting
- **mypy** — static type checking
- **tach** — structural/dependency boundary checks
Configure all tools for their strictest check levels by default. Include a `py.typed` marker file in every package to signal PEP 561 compliance.
### Line Length
Do not manually break lines to conform to a line-length limit. Automated code formatters (ruff, gofmt, etc.) handle this for source code. Write unbroken lines in text and Markdown files (e.g., README.md) as well. This also applies to one-off files outside of a project context.
### Licensing (REUSE)
In all projects, install a **pre-commit hook for the REUSE tool** to lint licensing information and ensure every file has correct SPDX headers.
Default license assignments:
- **GPL-3.0-or-later** — source code files in coding projects
- **CC-BY-SA-4.0** — documentation files (README, user guides, etc.); also the default project license for non-coding projects
- **CC0-1.0** — project configuration files (e.g., `pyproject.toml`, `tach.toml`) and small utility scripts or Makefiles that are not core to the implemented logic