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
id: prefer-dict-get
language: python
severity: hint
message: Use `$D.get($K, $DEFAULT)` instead of a conditional key lookup.
note: |
  `d.get(key, default)` is more concise and idiomatic than checking
  membership and indexing separately. This rule matches the ternary
  expression pattern `d[k] if k in d else default`.
rule:
  pattern: "$D[$K] if $K in $D else $DEFAULT"
fix: $D.get($K, $DEFAULT)
files:
  - "**/*.py"
  - "!tests/**"
  - "!**/test_*.py"
  - "!**/*_test.py"