|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- `litecli/`: Core package. Entry point `main.py`, SQL execution in `sqlexecute.py`, completion in `packages/completion_engine.py`, special commands under `packages/special/`. |
| 5 | +- `tests/`: Pytest suite (files like `test_*.py`). Test data under `tests/data/`. |
| 6 | +- `screenshots/`: Images used in README. |
| 7 | +- Config template: `litecli/liteclirc` (user config is created under `~/.config/litecli/config` or `%LOCALAPPDATA%/dbcli/litecli/config`). |
| 8 | + |
| 9 | +## Build, Test, and Development Commands |
| 10 | +- Create env: `python -m venv .venv && source .venv/bin/activate`. |
| 11 | +- Install dev deps: `pip install -e .[dev]`. |
| 12 | +- Run all tests + coverage: `tox`. |
| 13 | +- Style/lint (ruff): `tox -e style` (runs `ruff check --fix` and `ruff format`). |
| 14 | +- Extra tests with SQLean: `tox -e sqlean` (installs `[sqlean]` extras). |
| 15 | +- Run tests directly: `pytest -v` or focused: `pytest -k keyword`. |
| 16 | +- Launch CLI locally: `litecli path/to.db`. |
| 17 | + |
| 18 | +## Coding Style & Naming Conventions |
| 19 | +- Formatter/linter: Ruff (configured via `.pre-commit-config.yaml` and `tox`). |
| 20 | +- Indentation: 4 spaces. Line length: 140 (see `pyproject.toml`). |
| 21 | +- Naming: modules/functions/variables `snake_case`; classes `CamelCase`; tests `test_*.py`. |
| 22 | +- Keep imports sorted and unused code removed (ruff enforces). |
| 23 | + |
| 24 | +## Testing Guidelines |
| 25 | +- Framework: Pytest with coverage (`coverage run -m pytest` via tox). |
| 26 | +- Location: place new tests in `tests/` alongside related module area. |
| 27 | +- Conventions: name files `test_<unit>.py`; use fixtures from `tests/conftest.py`. |
| 28 | +- Quick check: `pytest -q`; coverage report via `tox` or `coverage report -m`. |
| 29 | + |
| 30 | +## Commit & Pull Request Guidelines |
| 31 | +- Commits: imperative mood, concise scope (e.g., `fix: handle NULL types`). Reference issues (`#123`) when relevant. |
| 32 | +- Update `CHANGELOG.md` for user-visible changes. |
| 33 | +- PRs: include clear description, steps to reproduce/verify, and screenshots or snippets for CLI output when helpful. Use the PR template. |
| 34 | +- Ensure CI passes (tests + ruff). Re-run `tox -e style` before requesting review. |
| 35 | + |
| 36 | +## Security & Configuration Tips |
| 37 | +- Do not commit local databases or secrets. Use files under `tests/data/` for fixtures. |
| 38 | +- User settings live outside the repo; document defaults by editing `litecli/liteclirc`. |
0 commit comments