litecli/: Core package. Entry pointmain.py, SQL execution insqlexecute.py, completion inpackages/completion_engine.py, special commands underpackages/special/.tests/: Pytest suite (files liketest_*.py). Test data undertests/data/.screenshots/: Images used in README.- Config template:
litecli/liteclirc(user config is created under~/.config/litecli/configor%LOCALAPPDATA%/dbcli/litecli/config).
- Create env:
python -m venv .venv && source .venv/bin/activate. - Install dev deps:
pip install -e .[dev]. - Run all tests + coverage:
tox. - Extra tests with SQLean:
tox -e sqlean(installs[sqlean]extras). - Run tests directly:
pytest -qor focused:pytest -k keyword. - Launch CLI locally:
litecli path/to.db.
- Full style pass:
tox -e style(runsruff check --fixandruff format). - Direct commands:
- Lint:
ruff check(add--fixto auto-fix) - Format:
ruff format
- Lint:
- Repo-wide
ty check -v - Per-package:
ty check litecli -v - Notes:
- Config is in
pyproject.toml(target Python 3.9, stricter settings).
- Config is in
- Formatter/linter: Ruff (configured via
.pre-commit-config.yamlandtox). - Indentation: 4 spaces. Line length: 140 (see
pyproject.toml). - Naming: modules/functions/variables
snake_case; classesCamelCase; teststest_*.py. - Keep imports sorted and unused code removed (ruff enforces).
- Use lowercase type hints for dict, list, tuples etc.
- Use | for Unions and | None for Optional.
- Framework: Pytest with coverage (
coverage run -m pytestvia tox). - Location: place new tests in
tests/alongside related module area. - Conventions: name files
test_<unit>.py; use fixtures fromtests/conftest.py. - Quick check:
pytest -q; coverage report viatoxorcoverage report -m.
- Commits: imperative mood, concise scope (e.g.,
fix: handle NULL types). Reference issues (#123) when relevant. - Update
CHANGELOG.mdfor user-visible changes. - PRs: include clear description, steps to reproduce/verify, and screenshots or snippets for CLI output when helpful. Use the PR template.
- Ensure CI passes (tests + ruff). Re-run
tox -e stylebefore requesting review.
- Always add an "Unreleased" section at the top of
CHANGELOG.mdwhen making changes. - Keep entries succinct; avoid overly detailed technical notes.
- Group under "Features", "Bug Fixes", and "Internal" when applicable.
- Do not commit local databases or secrets. Use files under
tests/data/for fixtures. - User settings live outside the repo; document defaults by editing
litecli/liteclirc.