Grader: file-contains
Taxonomy
Section titled “Taxonomy”| Property | Value |
|---|---|
| Determinism | static |
| Cost | low |
| Portability | t1-universal |
| Reference | reference-free |
| Temporal scope | trajectory-level |
| Score kind | code |
Config
Section titled “Config”graders: - type: file-contains config: path: "add.test.js" value: "expect"| Field | Type | Required | Description |
|---|---|---|---|
path | string | Yes | File path (or glob) to check |
value | string | Yes | Text that must appear in the file |
negate | boolean | No | When true, passes when the value is NOT found |
Negated variant
Section titled “Negated variant”Use file-not-contains as a shorthand for negate: true:
graders: - type: file-not-contains config: path: "*.csproj" value: "packages.config"This is equivalent to type: file-contains with negate: true.
Behavior
Section titled “Behavior”- Finds files matching
pathin the workspace using glob - Reads file contents
- Checks if the file contains
value(case-sensitive)
Passes when the value is found in at least one matching file (or NOT found if negated). Fails otherwise.
Evidence examples
Section titled “Evidence examples”✔ 'expect' found in add.test.js✘ 'expect' NOT found in add.test.js✘ No files matching 'add.test.js' found