Skip to content

chore: fix inaccuracies and improve AGENTS.md#369

Merged
nabinchha merged 3 commits intomainfrom
nmulepati/chore/update-agents.md
Mar 4, 2026
Merged

chore: fix inaccuracies and improve AGENTS.md#369
nabinchha merged 3 commits intomainfrom
nmulepati/chore/update-agents.md

Conversation

@nabinchha
Copy link
Contributor

📋 Summary

Fix stale/incorrect information in AGENTS.md and improve consistency by aligning documented conventions with actual project configuration.

🔄 Changes

✨ Added

  • Code organization guidelines (public before private, class method order, section comments)
  • Design principles: DRY (with "third occurrence" extraction rule), KISS (favor readability over deduplication), YAGNI, SOLID
  • Test guidelines: parametrize over duplicate, minimal fixtures, mock at boundaries, test behavior not implementation
  • Documented from __future__ import annotations as an explicit project-wide convention
  • Added make perf-import to Common Development Tasks section
  • Action verb naming rule for functions and methods

🐛 Fixed

  • Ruff version: v0.12.3>=0.14.10 (matches pyproject.toml)
  • Python target version: 3.11+3.10+ (matches requires-python and ruff target-version)
  • Active linter rules: added missing TID, UP006, UP007, UP045; removed UP from "commented out" list
  • Test example: added missing from typing import Any import and type annotations

🔧 Changed

  • Merged duplicate "Naming" subsections into one
  • Deduplicated type annotation guidance — Working Guidelines now references Code Style

🤖 Generated with AI

nabinchha and others added 2 commits March 4, 2026 14:08
…TS.md

- Code organization: public before private, class method ordering,
  section comments for larger modules
- Naming: function names must start with action verbs
- Design principles: DRY, KISS, YAGNI, SOLID guidelines
- Testing: parametrization, minimal fixtures, mock at boundaries,
  test behavior not implementation
- Update ruff version to >=0.14.10 and Python target to 3.10+
- Add missing linter rules (TID, UP006, UP007, UP045)
- Document `from __future__ import annotations` as project convention
- Merge duplicate Naming sections, deduplicate type annotation guidance
- Clarify DRY vs KISS tension with "third occurrence" rule of thumb
- Fix test example missing `Any` import
- Add `make perf-import` to Common Development Tasks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nabinchha nabinchha requested a review from a team as a code owner March 4, 2026 21:20
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR fixes several inaccuracies in AGENTS.md and expands it with new coding conventions, all verified against the actual project configuration in pyproject.toml and Makefile.

Corrections validated against source of truth:

  • Ruff version (v0.12.3>=0.14.10) correctly matches pyproject.toml (ruff>=0.14.10,<1)
  • Python target (3.11+3.10+) correctly matches both requires-python = ">=3.10" and target-version = "py310"
  • Active linter rule list now accurately reflects pyproject.toml: TID, UP006, UP007, UP045 added; UP removed from the commented-out list
  • make perf-import correctly documents the existing Makefile target

New guidelines added:

  • from __future__ import annotations as an explicit project-wide convention
  • Code organization rules (public-before-private, class method order with dunders first)
  • Design principles (DRY with third-occurrence rule, KISS, YAGNI, SOLID)
  • Test guidelines (parametrize, minimal fixtures, mock at boundaries, test behavior)
  • Action verb naming rule for functions and methods

One inconsistency found:

  • The test example (lines 529–538) does not include from __future__ import annotations, despite the same PR establishing it as a mandatory convention for all Python source files. As a canonical template, the example should demonstrate all required conventions.

Confidence Score: 4/5

  • Safe to merge — documentation-only change with accurate corrections and useful new guidelines; one minor inconsistency in the test example.
  • All factual corrections (ruff version, Python target, linter rules, perf-import command) are verified against pyproject.toml and the Makefile and are accurate. The new sections are well-reasoned and consistent with each other. The only issue is that the test code example (lines 529–538) omits from __future__ import annotations, which the same PR mandates for all Python source files. Since this is a canonical template developers will copy, adding this one import would make the example fully compliant and serve as better documentation.
  • AGENTS.md — test example snippet (lines 529–538) should include from __future__ import annotations to be consistent with the convention documented in the same PR.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[AGENTS.md Updates] --> B[Corrections]
    A --> C[New Guidelines]
    A --> D[Deduplications]

    B --> B1["Ruff version: v0.12.3 → >=0.14.10"]
    B --> B2["Python target: 3.11+ → 3.10+"]
    B --> B3["Active linter rules: +TID, +UP006, +UP007, +UP045\n-UP from commented-out list"]
    B --> B4["Test example: added type annotations\n+ from typing import Any"]

    C --> C1["from __future__ import annotations\nas project-wide convention"]
    C --> C2["Code Organization\n(public before private, method order)"]
    C --> C3["Design Principles\n(DRY, KISS, YAGNI, SOLID)"]
    C --> C4["Test Guidelines\n(parametrize, minimal fixtures,\nmock at boundaries)"]
    C --> C5["make perf-import in\nCommon Development Tasks"]
    C --> C6["Action verb rule for\nfunction/method names"]

    D --> D1["Merged duplicate Naming subsections"]
    D --> D2["Type annotation guidance\nconsolidated to Code Style section"]
Loading

Last reviewed commit: 5e2fc34

Update to match actual codebase convention: dunders first, then
properties, then public methods, then private helpers. Add note
about grouping related method types together.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 4, 2026

Additional Comments (1)

AGENTS.md, line 538
Test example missing from __future__ import annotations

The example test structure was updated to follow project conventions (adding from typing import Any and type annotations), but it's still missing from __future__ import annotations — which the document explicitly establishes as a required convention for every Python source file (lines 133 and 176):

ALWAYS include from __future__ import annotations at the top of every Python source file (after the license header) for deferred type evaluation

Since this snippet is the canonical template developers will copy, it should demonstrate the full set of required conventions. Consider adding it:

from __future__ import annotations

from typing import Any

from data_designer.config.config_builder import DataDesignerConfigBuilder

def test_something(stub_model_configs: dict[str, Any]) -> None:
    """Test description."""
    builder = DataDesignerConfigBuilder(model_configs=stub_model_configs)
    # ... test implementation
    assert expected == actual

@nabinchha nabinchha merged commit ddd6eb4 into main Mar 4, 2026
47 checks passed
@nabinchha nabinchha deleted the nmulepati/chore/update-agents.md branch March 4, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants