Commit 8b3bd0cd authored by Jan Reimes's avatar Jan Reimes
Browse files

πŸ§‘β€πŸ’» instructions: update AGENTS.md with new type hinting guidelines

- Added a guideline to avoid using `object` as a type hint
- Emphasized the use of `Any` from `typing` instead
parent d517207b
Loading
Loading
Loading
Loading
+1 βˆ’0
Original line number Diff line number Diff line
@@ -1019,6 +1019,7 @@ def get_tdoc(self, tdoc_id: str) -> TDocRecord | None:
- Use f-strings for formatting strings.
- Use list comprehensions and dictionary comprehensions where appropriate.
- Never use the obsolete type hint `x: Optional[SomeType] = None`! Instead, always use `x: SomeType | None = None`.
- Never use `object` as a type hint - use `Any` from `typing` instead.
- Use `is` and `is not` for comparing to `None`, not `==` or `!=`.
- Use `enumerate()` when you need both the index and the value in a loop.
- Use `with` statements when working with files to ensure proper resource management.
+2 βˆ’1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ dependencies = [
    "lxml>=6.0.2",
    "pandas>=2.3.3",
    "pydantic>=2.12.2",
    "pydantic-sqlite>=0.4.0",
    "python-calamine>=0.5.3",
    "python-dotenv>=1.1.1",
    "pyyaml>=6.0.3",
@@ -62,7 +63,7 @@ testpaths = ["tests"]
pythonpath = ["src"]

[tool.ruff]
target-version = "py313"
target-version = "py314"
line-length = 160
fix = true