vtcode 0.123.7

A Rust-based terminal coding agent with modular architecture supporting multiple LLM providers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
id: optional-to-union
language: python
severity: info
message: Prefer `T | None` over `Optional[T]` for Python 3.10+ codebases.
note: |
  PEP 604 union syntax (`T | None`) is more concise and readable than
  `Optional[T]`. Only apply this when the repository targets Python 3.10+
  and the typing policy prefers union syntax. This rule matches
  `Optional[T]` in type annotation context using `context` and `selector`
  to disambiguate from other subscript expressions.
rule:
  pattern:
    context: '$VAR: Optional[$T]'
    selector: generic_type
fix: $T | None
metadata:
  url: https://peps.python.org/pep-0604/