Skip to content

Commit ffe3814

Browse files
committed
ai(rules[AGENTS]) Add dataclasses exception to namespace import rule
why: The @DataClass decorator and field() are more readable with direct imports than using dataclasses.dataclass decorator syntax. what: - Add exception for dataclasses module to allow from-imports - Clarifies that dataclass, field can use direct import style
1 parent 2f4867c commit ffe3814

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ Key highlights:
211211
### Imports
212212

213213
- **Use namespace imports**: `import enum` instead of `from enum import Enum`
214+
- **Exception**: `dataclasses` module may use `from dataclasses import dataclass, field` for cleaner decorator syntax
214215
- **For typing**, use `import typing as t` and access via namespace: `t.NamedTuple`, etc.
215216
- **Use `from __future__ import annotations`** at the top of all Python files
216217

0 commit comments

Comments
 (0)