Skip to content

🖌️ adopt dprint #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 6, 2025
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
23 changes: 23 additions & 0 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"lineWidth": 88,
"json": {
"array.preferSingleLine": true,
"jsonTrailingCommaFiles": [".vscode/extensions.json", ".vscode/settings.json"],
},
"markdown": {
"emphasisKind": "asterisks",
// "textWrap": "always",
},
"yaml": {
"braceSpacing": false,
"formatComments": true,
"indentBlockSequenceInMap": false,
},
"excludes": ["**/*-lock.json", "**/*.lock", "dist/", "site/"],
"plugins": [
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
"https://plugins.dprint.dev/json-0.20.0.wasm",
"https://plugins.dprint.dev/markdown-0.19.0.wasm",
"https://plugins.dprint.dev/toml-0.7.0.wasm",
],
}
108 changes: 54 additions & 54 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,63 @@ title: "<Please write a comprehensive title>"
labels: ["stubs: Incorrect"]

body:
- type: markdown
attributes:
value: >
Thank you for taking the time to file a bug report. Before creating a new
issue, please make sure to take a few minutes to check the issue tracker
for existing issues about the bug.
- type: markdown
attributes:
value: >
Thank you for taking the time to file a bug report. Before creating a new
issue, please make sure to take a few minutes to check the issue tracker
for existing issues about the bug.

- type: textarea
attributes:
label: "Describe the issue:"
validations:
required: true
- type: textarea
attributes:
label: "Describe the issue:"
validations:
required: true

- type: textarea
attributes:
label: "Reproduce the code example:"
description: >
A short code example that reproduces the error in your type-checker.
It should be self-contained, i.e., can be run as-is via e.g. mypy myproblem.py or pyright myproblem.py.
placeholder: |
import numpy as np
<< your code here >>
render: python
validations:
required: true
- type: textarea
attributes:
label: "Reproduce the code example:"
description: >
A short code example that reproduces the error in your type-checker.
It should be self-contained, i.e., can be run as-is via e.g. mypy myproblem.py or pyright myproblem.py.
placeholder: |
import numpy as np
<< your code here >>
render: python
validations:
required: true

- type: textarea
attributes:
label: "Error message:"
description: >
Please include all relevant error messages from your type-checker or IDE.
placeholder: |
<< Full traceback starting from `Traceback: ...` or type checker output >>
render: shell
- type: textarea
attributes:
label: "Error message:"
description: >
Please include all relevant error messages from your type-checker or IDE.
placeholder: |
<< Full traceback starting from `Traceback: ...` or type checker output >>
render: shell

- type: textarea
attributes:
label: "Python and NumPy versions:"
description: >
Output from `import sys, numpy; print(numpy.__version__); print(sys.version)`.
validations:
required: true
- type: textarea
attributes:
label: "Python and NumPy versions:"
description: >
Output from `import sys, numpy; print(numpy.__version__); print(sys.version)`.
validations:
required: true

- type: textarea
attributes:
label: "Type-checker version and configuration:"
description: >
Please include the exact version of the type-checker you are using.
Popular (static) type checkers include Mypy, Pyright / Pylance, Pytype, Pyre, PyCharm, etc.
Also include the full CLI command used to run the type-checker, and all of the relevant configuration options.
validations:
required: true
- type: textarea
attributes:
label: "Type-checker version and configuration:"
description: >
Please include the exact version of the type-checker you are using.
Popular (static) type checkers include Mypy, Pyright / Pylance, Pytype, Pyre, PyCharm, etc.
Also include the full CLI command used to run the type-checker, and all of the relevant configuration options.
validations:
required: true

- type: textarea
attributes:
label: "Additional type packages:"
description: >
If you are using typing-extensions or typing-stub packages, please list their versions here.
validations:
required: false
- type: textarea
attributes:
label: "Additional type packages:"
description: >
If you are using typing-extensions or typing-stub packages, please list their versions here.
validations:
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ labels: ["topic: Docs"]

body:
- type: textarea
attributes:
attributes:
label: "Issue with current documentation:"
description: >
Please make sure to leave a reference to the document/code you're
Expand Down
50 changes: 25 additions & 25 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
allow:
- dependency-type: "all"
labels:
- "topic: dependencies"
- "tool: github-actions"
commit-message:
prefix: "⬆️ "
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
allow:
- dependency-type: "all"
labels:
- "topic: dependencies"
- "tool: github-actions"
commit-message:
prefix: "⬆️ "

- package-ecosystem: uv
directories:
- "/"
- "/tool"
schedule:
interval: daily
allow:
- dependency-type: "all"
versioning-strategy: increase
labels:
- "topic: dependencies"
- "tool: uv"
commit-message:
prefix: "⬆️ "
- package-ecosystem: uv
directories:
- "/"
- "/tool"
schedule:
interval: daily
allow:
- dependency-type: "all"
versioning-strategy: increase
labels:
- "topic: dependencies"
- "tool: uv"
commit-message:
prefix: "⬆️ "
15 changes: 12 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@
- any-glob-to-any-file:
- .github/workflows/**

"tool: lefthook":
- changed-files:
- any-glob-to-any-file:
- lefthook.yml

"tool: dprint":
- changed-files:
- any-glob-to-any-file:
- .dprint.jsonc

"topic: dependencies":
- changed-files:
- any-glob-to-any-file:
Expand All @@ -150,6 +160,5 @@
"topic: code style":
- changed-files:
- any-glob-to-any-file:
- .taplo.toml
- **/.ruff.toml

- .dprint.jsonc
- "**/.ruff.toml"
80 changes: 33 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI
permissions: read-all

on:
push:
Expand All @@ -10,10 +11,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

env:
UV_LOCKED: 1

Expand All @@ -23,37 +20,26 @@ jobs:
timeout-minutes: 1

steps:
- uses: actions/[email protected]

- name: typos
uses: crate-ci/[email protected]
- uses: actions/[email protected]

- name: markdownlint
uses: DavidAnson/[email protected]
with:
config: "docs/.markdownlint.yaml"
globs: "**/*.md"
- name: typos
uses: crate-ci/[email protected]

- uses: uncenter/[email protected]
with:
version: "0.9.3"
- name: taplo
run: |
taplo validate --colors never --no-schema
taplo fmt --colors never --check
- uses: astral-sh/[email protected]

- uses: astral-sh/[email protected]
- name: dprint
run: uv run dprint check

- name: ruff
run: |
uv run ruff check --output-format=github
uv run ruff format --check
- name: ruff
run: |
uv run ruff check --output-format=github
uv run ruff format --check

- name: pytest
run: uv run pytest
- name: format-ignores
run: uv run tool/format_ignores.py --check

- name: format-ignores
run: uv run tool/format_ignores.py --check
- name: pytest
run: uv run pytest

# NOTE: Static typing only differs between `python<3.12` and otherwise,
# so there's no need to run the type-checkers on all Python versions.
Expand All @@ -66,14 +52,14 @@ jobs:
matrix:
py: ["3.11", "3.13"]
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]

- uses: astral-sh/[email protected]
with:
python-version: ${{ matrix.py }}
- uses: astral-sh/[email protected]
with:
python-version: ${{ matrix.py }}

- name: basedpyright
run: uv run basedpyright
- name: basedpyright
run: uv run basedpyright

mypy:
runs-on: ubuntu-latest
Expand All @@ -83,14 +69,14 @@ jobs:
matrix:
py: ["3.11", "3.13"]
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]

- uses: astral-sh/[email protected]
with:
python-version: ${{ matrix.py }}
- uses: astral-sh/[email protected]
with:
python-version: ${{ matrix.py }}

- name: mypy
run: uv run --no-editable mypy --no-incremental --cache-dir=/dev/null .
- name: mypy
run: uv run --no-editable mypy --no-incremental --cache-dir=/dev/null .

# NOTE: Stubtest does runtime inspections, so we consider all Python versions.

Expand All @@ -103,11 +89,11 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
py: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]

- uses: astral-sh/[email protected]
with:
python-version: ${{ matrix.py }}
- uses: astral-sh/[email protected]
with:
python-version: ${{ matrix.py }}

- name: stubtest
run: uv run --active tool/stubtest.py
- name: stubtest
run: uv run --active tool/stubtest.py
Loading
Loading