Skip to content

Commit

Permalink
preprocessor: don't attempt to format .data files
Browse files Browse the repository at this point in the history
This establishes .data as the filename extension for arbitrary data
files that the preprocessor should neither attempt to format, nor worry
about not being able to format.

Preprocessor-No-Write-Cache: true
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Icad31ddcf46ceda30069afab0765004e4ce42e05
Dispatch-Trailer: {"type":"trybot","CL":1204403,"patchset":2,"ref":"refs/changes/03/1204403/2","targetBranch":"master"}
  • Loading branch information
jpluscplusm authored and cueckoo committed Nov 26, 2024
1 parent 0fd4d08 commit 46e6cb9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ when invoking a supported `cue` command:

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGV4cG9ydCAtVCAtLW91dCBjdWUgfCBzb3J0" }
$ cue export -T --out cue | sort
cpuArchitecture: "arm64"
currentHostname: "7c8be7f9b8ee"
currentTimeA: "2024-11-21T12:24:01.928819957Z"
currentTimeB: "2024-11-21T12:24:01.928819957Z"
cpuArchitecture: "amd64"
currentHostname: "fd46025f571f"
currentTimeA: "2024-07-24T12:16:36.998462958Z"
currentTimeB: "2024-07-24T12:16:36.998462958Z"
currentUsername: "root"
directory: "/home/runner"
operatingSystem: "linux"
randomnessA: 48143939811130088532707076255718137665
randomnessB: 48143939811130088532707076255718137665
randomnessA: 191422226613386244533905883473376449771
randomnessB: 191422226613386244533905883473376449771
```

In the CUE source, notice that the `rand` and `now` tag variables were
Expand All @@ -63,10 +63,10 @@ the `now` and `rand` variables are completely unstable, as demonstrated here by
their values being different to the values shown above:
```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGV2YWwgLVQgfCBncmVwIC1lIF5jdXJyZW50VGltZSAtZSBecmFuZG9t" }
$ cue eval -T | grep -e ^currentTime -e ^random
randomnessA: 256474124597080097645628343043781257633
randomnessB: 256474124597080097645628343043781257633
currentTimeA: "2024-11-21T12:24:03.630382379Z"
currentTimeB: "2024-11-21T12:24:03.630382379Z"
randomnessA: 311890454198696002262433839322444861509
randomnessB: 311890454198696002262433839322444861509
currentTimeA: "2024-07-24T12:16:38.716151613Z"
currentTimeB: "2024-07-24T12:16:38.716151613Z"
```

## Overridding system information
Expand All @@ -87,7 +87,7 @@ information for fields associated with the tag:
```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGV2YWwgLVR0IGY9MTIzMTIzMTIzMDAwIHwgZ3JlcCBecmFuZG9t" }
$ cue eval -Tt f=123123123000 | grep ^random
randomnessA: 123123123000
randomnessB: 154463835233876152095912350456117094604
randomnessB: 297085020426887323714942717980521585483
```

## Related content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ CUE: {
Retained: 0
}
Go: {
AllocBytes: 4079824
AllocObjects: 42098
AllocBytes: 4015312
AllocObjects: 42077
}
```

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/preprocessor/cmd/txtar_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (t *txtarRunContext) formatFiles() error {
case "proto":
// TODO: add support for proto formatting, after working out how to make
// this tooling generally available in the base docker image.
case "txt", "csv", "md", "java", "xml":
case "txt", "csv", "md", "java", "xml", "data":
// do nothing, simply avoid logging
default:
t.logf("%v: skipping formatting of file %q; unknown extension %q", t, a.Basename, a.Ext)
Expand Down

0 comments on commit 46e6cb9

Please sign in to comment.