Skip to content

gh-1027: Use the official astral hook for ty#1133

Merged
paddyroddy merged 9 commits into
mainfrom
paddy/issue-1027
Jun 15, 2026
Merged

gh-1027: Use the official astral hook for ty#1133
paddyroddy merged 9 commits into
mainfrom
paddy/issue-1027

Conversation

@paddyroddy

@paddyroddy paddyroddy commented Jun 10, 2026

Copy link
Copy Markdown
Member

Description

https://github.com/astral-sh/ty-pre-commit finally exists. In #926 we migrated from mypy to ty. Some further work was done in #1091 to make it more reliable. Now we can go back to simple pre-commit. There are a fair amount of options to investigate.

Closes: #1027

Changelog entry

Changed: ty is now run through pre-commit

Checks

  • Is your code passing linting?
  • Is your code passing tests?
  • Have you added additional tests (if required)?
  • Have you modified/extended the documentation (if required)?
  • Have you added a one-liner changelog entry above (if required)?

@paddyroddy paddyroddy self-assigned this Jun 10, 2026
@paddyroddy paddyroddy added enhancement New feature or request infrastructure Project infrastructure: dev tools, packaging, etc. labels Jun 10, 2026
@paddyroddy paddyroddy marked this pull request as ready for review June 10, 2026 16:32
@paddyroddy paddyroddy requested a review from Copilot June 10, 2026 16:32
@paddyroddy paddyroddy marked this pull request as draft June 10, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the project’s type-checking workflow to run ty via the official astral-sh/ty-pre-commit hook again, simplifying the nox lint session to rely on prek/pre-commit for running checks.

Changes:

  • Add the official ty-pre-commit hook and configure it to run with the lint dependency group.
  • Remove the explicit ty check invocation from the nox -s lint session and forward nox positional args to prek.
  • Expand the lint dependency group to include packages needed for ty to analyze the configured source set.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pyproject.toml Expands the lint dependency group to support running ty via pre-commit/uv groups.
noxfile.py Simplifies the lint session to run only prek (pre-commit hooks), with forwarded posargs.
.pre-commit-config.yaml Adds the official astral-sh/ty-pre-commit hook and configures its execution flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread noxfile.py
Comment thread pyproject.toml Outdated
Comment thread .pre-commit-config.yaml
@paddyroddy paddyroddy requested a review from Copilot June 11, 2026 14:20
@paddyroddy paddyroddy marked this pull request as ready for review June 11, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread noxfile.py
@paddyroddy paddyroddy requested a review from connoraird June 11, 2026 14:27
@paddyroddy paddyroddy merged commit 82a02ca into main Jun 15, 2026
13 checks passed
@paddyroddy paddyroddy deleted the paddy/issue-1027 branch June 15, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request infrastructure Project infrastructure: dev tools, packaging, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace the local ty hook with the official Astral hook

3 participants