What does it do?
Developers run gawain check on a file to find missing type annotations. In the default obvious mode, annotations may be omitted for clear literal values that are not reassigned, among other cases; strict mode requires annotations for every assignment. After the annotation check, it runs ty or pyrefly on the same file and outputs diagnostics. An option checks annotations without a type checker, and exit codes based on errors support automation.
Key features
- Checks for missing type annotations on variables, parameters, return values, and class attributes.
- Runs ty or pyrefly on the same file after checking annotations.
- Provides obvious mode and strict mode, which requires annotations for every assignment.
- Can check annotations without running a type checker.
- Returns exit code 0, 1, or 2 according to the check result.