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
1 change: 1 addition & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.14"
- run: uv sync --extra dev # for ty
- run: SKIP=no-commit-to-branch uvx prek run --all-files --show-diff-on-failure

check:
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ venv.bak/
# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

Expand Down
16 changes: 13 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ci:
autofix_commit_msg: 'style: pre-commit.ci fixes'
skip:
- markdownlint # TODO: try to enable again
- ty-check

repos:
- repo: meta
Expand Down Expand Up @@ -135,10 +136,19 @@ repos:
- id: yamllint
args:
- --strict
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.20.2
- repo: local
hooks:
- id: mypy
- id: ty-check
name: ty-check
language: python
entry: ty check
pass_filenames: false
args:
- --python=.venv/
additional_dependencies:
- ty==0.0.32
types:
- python
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
Expand Down
24 changes: 5 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ dependencies = [
dev = [
"pytest>=9.0.3",
"pytest-cov",
"pyfakefs"
"pyfakefs",
"types-regex"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In contrast to mypy, ty can't work with this type, see this run. So, we need to install the stubs

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Do you think this would work when adding to the additional dependencies as we do for ty itself? Iguess not since we point ty to our venv, but just wanted to double check.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Doesn't work. Probably because we point ty to uv's .venv, so it doesn't see modules added to prek's venv via additional_dependencies.

]

[project.scripts]
Expand All @@ -41,24 +42,6 @@ print-pre-commit-metrics = "dev_tools.print_pre_commit_metrics:main"
sync-vscode-config = "dev_tools.sync_vscode_config:main"
sync-tool-versions = "dev_tools.sync_tool_versions:main"

[tool.mypy]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
Comment on lines -44 to -60
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These are all on in ty per default


[tool.pytest.ini_options]
addopts = "--cov-report term-missing --cov=dev_tools --cov=packages/whoowns/whoowns --cov=packages/configure_vscode_for_bazel/configure_vscode_for_bazel -vv"
testpaths = [
Expand Down Expand Up @@ -98,6 +81,9 @@ ignore = [
"S101" # allow assertions in tests
]

[tool.ty.terminal]
error-on-warning = true

[tool.uv.build-backend]
module-root = "" # required to avoid the "src" layout, which is the default for uv_build

Expand Down
11 changes: 11 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading