feat: add type hints, new CLI features, and improve project structure

chore: add uv.lock to gitignore

Major changes:
- Add type hints and docstrings to all functions (PEP 484)
- Add __main__.py for module execution (python -m genpass)
- Expose public API in __init__.py
- Add config file support (~/.genpass/config.json)
- Add entropy calculation (--entropy)
- Add clipboard support (--clipboard/-c)
- Add ambiguous characters exclusion (--no-ambiguous)
- Add output formats: plain, json, delimited (--format)
- Add sensible defaults (all character types enabled by default)
- Add input validation for length and count
- Update shell completions for all new options
- Add pre-commit config with ruff, mypy, black
- Update pyproject.toml with dev dependencies and tool configs
- Add requirements.txt and requirements-dev.txt
- Update README.md with comprehensive examples

BREAKING CHANGE: Default behavior now includes all character types
This commit is contained in:
kilyabin
2026-03-10 00:42:16 +04:00
parent c11345d576
commit eeca690c0a
13 changed files with 969 additions and 67 deletions

19
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
hooks:
- id: mypy
additional_dependencies: []
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
hooks:
- id: black
language_version: python3