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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ coverage_badge_gist_username: davidbrownell
github_host: https://github.com
github_repo_name: dbrownell_CommitEmojis
github_username: davidbrownell
install_ty: false
install_ty: true
license: MIT
project_name: dbrownell_CommitEmojis
python_package_name: dbrownell_CommitEmojis
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ repos:
language: system
pass_filenames: false
always_run: true

- id: uv run ty check
name: uv run ty check
entry: uv run ty check
language: system
pass_filenames: false
always_run: true
1 change: 1 addition & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
| --- | --- | --- | :-: | :-: |
| Code Formatting | `uv run ruff format` or<br>`uv run ruff format --check` | Format source code using [ruff](https://github.com/astral-sh/ruff) based on settings in `pyproject.toml`. | :white_check_mark: | :white_check_mark: (via [pre-commit](https://pre-commit.com/)) |
| Static Code Analysis | `uv run ruff check` | Validate source code using [ruff](https://github.com/astral-sh/ruff) based on settings in `pyproject.toml`. | :white_check_mark: | :white_check_mark: (via [pre-commit](https://pre-commit.com/)) |
| Static Type Checking | `uv run ty check` | Run static type checking using [ty](https://github.com/astral-sh/ty) based on settings in `pyproject.toml`. | :white_check_mark: | :white_check_mark: (via [pre-commit](https://pre-commit.com/)) |
| Run pre-commit scripts | `uv run pre-commit run` | Run [pre-commit](https://pre-commit.com/) scripts based on settings in `.pre-commit-config.yaml`. | :white_check_mark: | :white_check_mark: |
| Automated Testing | `uv run pytest` or<br/>`uv run pytest --no-cov` | Run automated tests using [pytest](https://docs.pytest.org/) and extract code coverage using [coverage](https://coverage.readthedocs.io/) based on settings in `pyproject.toml`. | :white_check_mark: | :white_check_mark: |
| Semantic Version Generation | `uv run python -m AutoGitSemVer.scripts.UpdatePythonVersion ./pyproject.toml ./src` | Generate a new [Semantic Version](https://semver.org/) based on git commits using [AutoGitSemVer](https://github.com/davidbrownell/AutoGitSemVer). Version information is stored in `pyproject.toml`. | | :white_check_mark: |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
**Development:**
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![ty](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ty/main/assets/badge/v0.json)](https://github.com/astral-sh/ty)
[![pytest](https://img.shields.io/badge/pytest-enabled-brightgreen)](https://docs.pytest.org/)
[![CI](https://github.com/davidbrownell/dbrownell_CommitEmojis/actions/workflows/CICD.yml/badge.svg)](https://github.com/davidbrownell/dbrownell_CommitEmojis/actions/workflows/CICD.yml)
[![Code Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/davidbrownell/f15146b1b8fdc0a5d45ac0eb786a84f7/raw/dbrownell_CommitEmojis_code_coverage.json)](https://github.com/davidbrownell/dbrownell_CommitEmojis/actions)
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CommitEmojis = "dbrownell_CommitEmojis:__main__.app"
commit_emojis = "dbrownell_CommitEmojis:__main__.app"

[build-system]
requires = ["uv_build>=0.8.15,<0.9.0"]
requires = ["uv_build>=0.11.3,<0.12.0"]
build-backend = "uv_build"

[dependency-groups]
Expand All @@ -61,6 +61,7 @@ dev = [
"ruff>=0.12.3",
"syrupy>=4.9.1",
"textual-dev>=1.7.0",
"ty>=0.0.27",
]

[tool.pytest.ini_options]
Expand Down
4 changes: 2 additions & 2 deletions src/dbrownell_CommitEmojis/Lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def Display(
table.add_column(
col_name,
footer or "",
justify=justify,
justify=justify, # ty: ignore[invalid-argument-type]
)
Comment on lines 157 to 161
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # ty: ignore[invalid-argument-type] on Table.add_column(..., justify=...) bypasses type checking for this call. A more robust fix is to type justify as Rich’s expected literal type (or cast it to that type) so ty can still validate the rest of the call.

Copilot uses AI. Check for mistakes.

for item in items:
Expand Down Expand Up @@ -258,5 +258,5 @@ def _YieldConsole(
return

with done_manager_or_console.YieldStdout() as stdout_stream:
console = Console(file=stdout_stream.stream)
console = Console(file=stdout_stream.stream) # ty: ignore[invalid-argument-type]
yield console
Comment on lines 260 to 262
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # ty: ignore[invalid-argument-type] on Console(file=stdout_stream.stream) hides a type mismatch that could indicate the stream isn’t the text IO Rich expects. Prefer adapting or casting stdout_stream.stream to the appropriate TextIO/IO[str] type (or updating the DoneManager type hints) so ty can validate this call without an ignore.

Copilot uses AI. Check for mistakes.
6 changes: 5 additions & 1 deletion src/dbrownell_CommitEmojis/MainApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def on_button_pressed(self, event: Button.Pressed) -> None: # noqa: D102

# ----------------------------------------------------------------------
def on_data_table_row_selected(self, event: DataTable.RowSelected) -> None: # noqa: D102
assert event is not None
assert event.row_key is not None
assert isinstance(event.row_key.value, tuple)

emoji, alias = event.row_key.value # type: ignore[attr-defined, misc]

match = self._commit_regex.match(self._commit_message_input.value)
Expand Down Expand Up @@ -196,7 +200,7 @@ def ShouldInclude(info: EmojiInfo) -> bool:
item.name,
item.description,
", ".join(item.aliases),
key=(item.emoji, item.aliases[0] if item.aliases else ""), # type: ignore[arg-type]
key=(item.emoji, item.aliases[0] if item.aliases else ""), # ty: ignore[invalid-argument-type]
)

collapsible.children[1].mount(dt)
2 changes: 1 addition & 1 deletion src/dbrownell_CommitEmojis/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def EntryPoint(
command: Annotated[
Command,
typer.Argument(help="Command to invoke."),
] = "UX",
] = Command.UX,
message_or_filename: Annotated[
str,
typer.Argument(..., help="Message to transform (or filename that contains the message)."),
Expand Down
Loading
Loading