Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ jobs:
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- run: pip install -e ".[dev]"
- run: pytest --cov=check_unicode --cov-fail-under=80
- run: ruff check src/ tests/
- run: mypy src/
- run: uv sync --group dev
- run: uv run pytest --cov=check_unicode --cov-fail-under=80
- run: uv run ruff check src/ tests/
- run: uvx ty check src/
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ dist/
build/
.venv/
.pytest_cache/
.mypy_cache/
.ty/
.ruff_cache/
.coverage
uv.lock
10 changes: 6 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ repos:
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
- repo: local
hooks:
- id: mypy
args: [--strict, src/]
- id: ty
name: ty check
entry: uvx ty check src/
language: system
pass_filenames: false
always_run: true

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### Changed

- Replace mypy with [ty](https://github.com/astral-sh/ty) for type checking
- Move dev dependencies from `optional-dependencies` to `dependency-groups`
- Switch CI from pip to uv for faster, reproducible installs; check in `uv.lock`
- Extract codepoint/range parsing into `check_unicode.parsing` module for reuse
- Codepoint parser now validates the Unicode range (0..U+10FFFF) and rejects
empty/invalid input with clear error messages
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Thanks for your interest in contributing to `check-unicode`.
## Development setup

```bash
uv venv && uv pip install -e ".[dev]"
uv venv && uv sync --group dev
```

## Before submitting a PR
Expand All @@ -15,7 +15,7 @@ uv venv && uv pip install -e ".[dev]"
```bash
pytest --cov=check_unicode
ruff check src/ tests/
mypy src/
uvx ty check src/
```

2. Add or update tests for any new behavior.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ Found 5 non-ASCII characters in 2 files (3 fixable, 1 dangerous)
## Development

```bash
uv venv && uv pip install -e ".[dev]"
uv venv && uv sync --group dev
.venv/bin/pytest -v --cov
.venv/bin/ruff check src/ tests/
.venv/bin/mypy src/
uvx ty check src/
```

## License
Expand Down
20 changes: 15 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ classifiers = [
"Topic :: Software Development :: Quality Assurance",
]
dynamic = [ "version" ]
optional-dependencies.dev = [ "bump-my-version", "mypy", "pytest", "pytest-cov", "ruff" ]
urls.Changelog = "https://github.com/mit-d/check-unicode/blob/main/CHANGELOG.md"
urls.Issues = "https://github.com/mit-d/check-unicode/issues"
urls.Repository = "https://github.com/mit-d/check-unicode"
scripts.check-unicode = "check_unicode.main:main"

[dependency-groups]
dev = [
"bump-my-version",
"pytest",
"pytest-cov",
"ruff",
"ty",
]

[tool.hatch]
build.targets.wheel.packages = [ "src/check_unicode" ]
build.targets.sdist.include = [ "src/", "docs/check-unicode.1" ]
Expand Down Expand Up @@ -74,7 +82,9 @@ files = [
{ filename = "docs/check-unicode.1", search = "rev: v{current_version}", replace = "rev: v{new_version}" },
]

[tool.mypy]
python_version = "3.11"
strict = true
exclude = [ "tests/fixtures/" ]
[tool.ty]
environment.python-version = "3.11"
environment.extra-paths = [ "src" ]
src.exclude = [ "tests/fixtures/" ]
terminal.error-on-warning = true
rules.all = "error"
685 changes: 685 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading