Compare commits

..

7 Commits

Author SHA1 Message Date
Gud Boi fd8d81becf Add `/lint` skill with `scripts/check.py`
Add a user-invocable `/lint` skill that wraps
`ruff check` with staged-file defaults and piker's
`ruff.toml` config via a PEP 723 script.

The `ruff.toml` (from prior commit) now enforces
piker's `'''` multiline docstring convention with
`D2xx` formatting rules: summary on second line
(D213), closing quotes on separate line (D209), blank
line between summary and description (D205), plus
`W` trailing-whitespace and cherry-picked `D4xx`
content checks.

Deats,
- `scripts/check.py`: pure-stdlib wrapper that
  defaults to staged `.py` files via
  `git diff --cached`, with `--all`, `--fix`,
  `--diff`, and `--stats` flags.
- calls `ruff` from `$PATH` (works with nixpkgs,
  nvim-bundled, or pip-installed).
- prints clear install guidance if `ruff` not found.
- `SKILL.md`: documents usage, common violations
  (D213, D205, D204), and fix patterns for
  converting to piker's docstring style.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-17 18:04:36 -04:00
Gud Boi d92a687dc7 Add pydocstyle and `W` rules to `ruff.toml`
Enable `D2xx` formatting rules to enforce piker's `'''`
multiline docstring convention: summary on second line
(D213), closing quotes on separate line (D209), blank
line between summary and description (D205).

Deats,
- select `D2` (whitespace/formatting) rule group plus
  cherry-picked `D402`/`D403`/`D419` content checks.
- ignore `D200` (allow multiline for short docstrings),
  `D203` (use `D211` instead), `D212` (use `D213`).
- skip `D1xx` (missing-docstring) to avoid noise and
  `D3xx` since `D300` conflicts with `'''` convention.
- add `W` rules for trailing-whitespace detection.

Also,
- enable `docstring-code-format` with 67-char width
  for code examples inside docstrings.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-17 18:04:36 -04:00
Gud Boi 75673d3d1f WIP get him to write a ruff conf to match our code 2026-03-17 18:04:36 -04:00
Gud Boi 4c6957db51 Move commit-msg output to `msgs/` subdir
Relocate generated commit message files from
`.claude/` root into `.claude/skills/commit-msg/msgs/`
and switch timestamp format to filesystem-safe UTC
(`%Y%m%dT%H%M%SZ`).

Also,
- add `msgs/` dir and `git_commit_msg_LATEST.md` to
  `.gitignore`.

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-17 18:03:57 -04:00
Gud Boi c23d034935 Merge pull request 'Swap `tractor.to_asyncio.open_channel_from()` yield-pair order' (#90) from to_asyncio_api_update into main
Reviewed-on: https://www.pikers.dev/pikers/piker/pulls/90
Reviewed-by: guille <guillermo@telos.net>
2026-03-17 21:58:15 +00:00
Gud Boi 347a2d67f9 Pin to `tractor` upstream `main` branch 2026-03-17 16:51:15 -04:00
Gud Boi b22c59e7a0 Swap `open_channel_from()` yield-pair order
Match upstream `tractor` API change where
`open_channel_from()` now yields `(chan, first)`
instead of `(first, chan)` — i.e.
`tuple[LinkedTaskChannel, Any]`.

- `brokers/ib/api.py`
- `brokers/ib/broker.py`
- `brokers/ib/feed.py`
- `brokers/deribit/api.py` (2 sites)

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-17 15:06:30 -04:00
8 changed files with 18 additions and 17 deletions

View File

@ -69,13 +69,13 @@ When generating a commit message:
conventions from the
[style guide](./style-guide-reference.md).
4. Add body only for multi-file or complex changes.
5. Write the message to a file in the repo's
`.claude/` subdir with filename format:
`<timestamp>_<first-7-chars-of-last-commit-hash>_commit_msg.md`
where `<timestamp>` is from `date --iso-8601=seconds`.
Also write a copy to
`.claude/git_commit_msg_LATEST.md`
(overwrite if exists).
5. Write the message to TWO files:
- `.claude/skills/commit-msg/msgs/<timestamp>_<hash>_commit_msg.md`
* with `<timestamp>` from `date -u +%Y%m%dT%H%M%SZ`
or similar filesystem-safe format.
* and `<hash>` from `git log -1 --format=%h`
first 7 chars.
- `.claude/git_commit_msg_LATEST.md` (overwrite)
---

2
.gitignore vendored
View File

@ -107,6 +107,8 @@ ENV/
.git/
# any commit-msg gen tmp files
.claude/skills/commit-msg/msgs/
.claude/git_commit_msg_LATEST.md
.claude/*_commit_*.md
.claude/*_commit*.toml

View File

@ -586,7 +586,7 @@ async def open_price_feed(
fh,
instrument
)
) as (first, chan):
) as (chan, first):
yield chan
@ -653,7 +653,7 @@ async def open_order_feed(
fh,
instrument
)
) as (first, chan):
) as (chan, first):
yield chan

View File

@ -1529,7 +1529,7 @@ async def open_client_proxies() -> tuple[
# TODO: maybe this should be the default in tractor?
key=tractor.current_actor().uid,
) as (cache_hit, (clients, _)),
) as (cache_hit, (_, clients)),
AsyncExitStack() as stack
):
@ -1718,7 +1718,7 @@ async def open_client_proxy(
open_aio_client_method_relay,
client=client,
event_consumers=event_table,
) as (first, chan),
) as (chan, first),
trionics.collapse_eg(), # loose-ify
trio.open_nursery() as relay_tn,

View File

@ -514,8 +514,8 @@ async def open_trade_event_stream(
recv_trade_updates,
client=client,
) as (
_, # first pushed val
trade_event_stream,
_, # first pushed val
):
task_status.started(trade_event_stream)
# block forever to keep session trio-asyncio session

View File

@ -989,7 +989,7 @@ async def open_aio_quote_stream(
symbol=symbol,
contract=contract,
) as (contract, from_aio):
) as (from_aio, contract):
assert contract

View File

@ -203,9 +203,8 @@ pyvnc = { git = "https://github.com/regulad/pyvnc.git" }
# xonsh = { git = 'https://github.com/xonsh/xonsh.git', branch = 'main' }
# XXX since, we're like, always hacking new shite all-the-time. Bp
tractor = { git = "https://github.com/goodboy/tractor.git", branch ="piker_pin" }
tractor = { git = "https://github.com/goodboy/tractor.git", branch ="main" }
# tractor = { git = "https://pikers.dev/goodboy/tractor", branch = "piker_pin" }
# tractor = { git = "https://pikers.dev/goodboy/tractor", branch = "main" }
# ------ goodboy ------
# hackin dev-envs, usually there's something new he's hackin in..
# tractor = { path = "../tractor", editable = true }

View File

@ -1034,7 +1034,7 @@ requires-dist = [
{ name = "tomli", specifier = ">=2.0.1,<3.0.0" },
{ name = "tomli-w", specifier = ">=1.0.0,<2.0.0" },
{ name = "tomlkit", git = "https://github.com/pikers/tomlkit.git?branch=piker_pin" },
{ name = "tractor", git = "https://github.com/goodboy/tractor.git?branch=piker_pin" },
{ name = "tractor", git = "https://github.com/goodboy/tractor.git?branch=main" },
{ name = "trio", specifier = ">=0.27" },
{ name = "trio-typing", specifier = ">=0.10.0" },
{ name = "trio-util", specifier = ">=0.7.0,<0.8.0" },
@ -1676,7 +1676,7 @@ wheels = [
[[package]]
name = "tractor"
version = "0.1.0a6.dev0"
source = { git = "https://github.com/goodboy/tractor.git?branch=piker_pin#566a17ba92469000a01fd18c709ea3e336e72796" }
source = { git = "https://github.com/goodboy/tractor.git?branch=main#e77198bb64f0467a50e251ed140daee439752354" }
dependencies = [
{ name = "bidict" },
{ name = "cffi" },