Repository navigation
fix(lint): widen three Python model-rule selectors deferred in #196 - #258
Conversation
- no-reaching-through-collaborators: select a chain of three member accesses whether or not a call ends it (`order.customer.address.city`). - no-exposed-mutable-collection: select a function that returns a public field as it is (`return self.items`), not only a private one. - no-comment-restating-code: select a function or its decorators placed just below a comment that is not a tool directive. Each suite gains a fixture for the new shape. The matcher change makes the saved baselines stale; they need `jev-lint eval --accept`. Refs #196 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Review summary: no correctness or security bugs found in the selector changes. The new fixture line numbers in the three
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f21bb88ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…lper The comment rule now also selects a comment just above a function, so its question names that place too. The bad fixture becomes a private helper: a comment on a public function documents its API, which the criteria exempt. Refs #196 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Review summaryI read the diff only. I did not run the tests or the selectors, because the sandbox blocked my script that runs P1: merge blocker the PR already discloses. The three changed matchers invalidate their P2 (inline): P3 (inline): The Demeter selector change ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ab1c1391a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Refs #196 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Review summaryI found one blocking problem and one optional improvement. I read the diff without running the test suite.
The selector logic otherwise looks right. The 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The user re-ran `jev-lint eval --accept` for the three suites whose matchers changed. no-comment-restating-code moves to 0.62 and drops its stale inconclusive exemption; the other two keep their cutoffs. The property-chain and above-function cases score under the conforming range and are recorded as Limits. Refs #196 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Review summaryNo blocking findings (no P0 or P1). I read the three What looks right:
Notes, none of which should block the merge:
Test coverage: each selector change has a Red/Green selector test. There is no test for the trailing-comment case above. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🤖 I have created a release *beep* *boop* --- ## [0.3.1](v0.3.0...v0.3.1) (2026-11-20) ### Bug Fixes * **hooks:** do not count a printf whose format holds %n as writing nothing ([#262](#262)) ([f3a4543](f3a4543)) * **hooks:** judge gh beside commands that write nothing as gh alone ([#256](#256)) ([540bbad](540bbad)) * **hooks:** stop asking for gh calls whose target and arguments are known at hook time ([#254](#254)) ([f4aa355](f4aa355)) * **lint:** close the Rust and TypeScript items of [#196](#196) ([#259](#259)) ([1d2a81e](1d2a81e)) * **lint:** select the Go model-rule forms deferred in [#196](#196) ([#257](#257)) ([8c347fe](8c347fe)) * **lint:** widen three Python model-rule selectors deferred in [#196](#196) ([#258](#258)) ([b3fc801](b3fc801)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
概要
#196 の Python 項目(#192 の後続,
py_*規則,Python の model rule,#191 の Python 部分)を origin/main で確かめた.ast-grep の項目は #192・#216・#240 で対応済みか obsolete だった.残っていた Python の model rule の selector 3 件を広げた(#196 の方針どおり matcher は広く取り,判定は criteria に任せる).どの規則も advisory のままで,昇格も文章の削除もしていない(ADR-0027).Refs #196
変更
no-reaching-through-collaborators:呼び出しで終わらないプロパティ参照の連鎖(return order.customer.address.city)も選ぶ.selector を$A.$B.$C.$D($$$)から$A.$B.$C.$Dにした(呼び出しの連鎖も含む).no-exposed-mutable-collection:公開名のフィールドをそのまま返す関数(return self.items)も選ぶ.return len(self.items)のような計算結果は選ばない.no-comment-restating-code:関数の直前(デコレータの上を含む)にある,tool directive でないコメントも選ぶ.規則はaxis: fileなのでモデルにはファイル全体が渡り,直前のコメントも見える.expect.ymlに label を足した.既存の行番号は動かしていない.tests/test_python_model_rules.py:3 件の selector テストを追加(Red は 3 件とも subject 0 で確認).tests/test_agents_md_model_rules.py:Python の共通サンプルでlabel(return self.text)が新たに選ばれるので期待値を 2 にした.項目ごとの状態
string-literal-is-named-constant:parent:が ast-grep のキーでないparent:は無い(#216 で obsolete と整理)py_definition_order:ColorMixin[T]を Enum 扱いpy_async_test_anyio_marker(部分一致,fixture 経由,別名 receiver,anyio_mode = "auto")py_plain_class_slots(アンパック代入,__dict__,class User()/(object))plain-class-defines-slotsへ降格(#192)py_pydantic_validate_json(初期化,jsonの束縛,複数名 import の別名)json-parse-uses-model-validate-jsonへ降格(#192)py_frozen_base_model_config:model_configの再代入frozen-base-model-sets-all-settingsへ(#192)py_frozen_base_model_no_override:ConfigDict(**{...})frozen-model-subclass-keeps-locked-settingsへ(#192)py_pydantic_base_model_only_in_frozen_base:pydantic.v1from pydantic.v1 import BaseModelとpydantic.v1.BaseModelを invalid に追加済み.別名は規則の Limits)py_no_pytest_asyncio:別名pytest経由のマーカーLimits:に記録(バインド解析が要る.ADR-0021 の方針で demote しない)py_dataclass_slotscached_propertyの別名)は #192 内で修正済み.#196 に未解決の個別項目は無いfixture-justified:基準の衝突json-parse-uses-model-validate-json:callee で照合frozen-model-subclass-keeps-locked-settings:別ファイルの基底locatedのまま,別ファイルの中間クラスは Limits)no-comment-restating-code:Python の docstringtests/test_agents_md_model_rules.pyのdocumented)no-comment-restating-code:関数直前のコメント(Python 分)no-exposed-mutable-collection:Python 公開名のフィールドno-reaching-through-collaborators:プロパティ参照の連鎖(Python 分)test_python_style_model_rules_select_the_subjects_they_ask_aboutbaseline の再取得と cutoff
matcher を変えた 3 suite の baseline は,ユーザーが
jev-lint eval --acceptで取り直した(2026-11-19T12:18Z,3 passes).cutoff と根拠のコメントをその値に合わせた(a70d16d5).問い(ask / criteria)はその後変えていない.no-reaching-through-collaboratorsno-exposed-mutable-collectionno-comment-restating-codeinconclusive:を削除Limits
no-reaching-through-collaborators:呼び出しで終わらないプロパティ連鎖は選ぶようになったが,fixture では 0.68(clean の 0.67 と 0.72 の間)で,どの cutoff でも分離しない.今は見逃す(FN).no-comment-restating-code:関数直前のコメントは選ぶようになったが,fixture の言い換えコメントは 0.11 で見逃す(FN).またfollowsは直前の兄弟コメントを何でも選ぶので,前の文の行末コメント(TIMEOUT = 5 # seconds),空行を挟んだ区切りコメント,複数行コメントの最終行だけを directive 判定する場合にも subject が増える(余分な問い合わせ.2 回目のレビュー指摘).no-exposed-mutable-collection:公開フィールドの getter(return self.name)をすべて選ぶので subject が増える(fix(lint): address review findings deferred from the #74 migration PRs #196 の方針で matcher は広く取る).return (self.items)のように括弧で包む書き方は選ばない(見逃し.2 回目のレビュー指摘).CsvRow の FP(0.94)は従来どおり残る.レビュー対応
no-comment-restating-codeの ask を「in this function, or just above it」に合わせた.関数直前コメントの bad fixture を非公開 helper にした(7ab1c139).baseline は上のとおり再取得した.テスト
uv run pytest:replay を含む model rule のテストが通過.jev-lint eval --replay:74 suite すべて通過.🤖 Generated with Claude Code