vtcode 0.123.10

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
18
id: no-global-variable
language: Go
severity: warning
message: Avoid package-level mutable variables; prefer dependency injection or constants.
note: |
  Package-level `var` declarations create global mutable state that makes code
  harder to test and reason about. Prefer passing dependencies as function
  parameters, using constants for immutable values, or encapsulating state in
  structs. This rule excludes test files but will flag all package-level
  variables, including those used only in `init()` functions.
rule:
  kind: var_declaration
  inside:
    kind: source_file
files:
  - "**/*.go"
  - "!**/*_test.go"
  - "!**/examples/**"