You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bda1961
Browse filesBrowse the repository at this point in the historyBrowse files
engine, core: the engine's refusals arrive in three parts too
The last layer that still handed a report one sentence. Seventeen messages
behind one type, so unlike the format and preset refusals they cannot each
assemble their own - there is one join rule for all of them, and that is why
this was a decision rather than a mechanical change.
The rule is how these refusals have always read: what is wrong, a dash, why the
rule is there, a full stop, what to do instead. A message that has not been cut
into parts carries all of it in Detail and comes out exactly as before, so
there is no half finished middle - the same sentence written in one piece or in
three.
Measured against the previous binary, thirty nine refusals and every stored
screen. Three fold back byte for byte: the ceiling on files, the output
directory that is a file, and the name template. Two were left alone because
they have nothing to separate. Twelve change, all the same way and nothing
gained or lost - a full stop or a colon between what and why becomes a dash,
the dash before what to do becomes a full stop, and the remedy takes a capital
letter:
before: ... which holds the character "<". Windows refuses that character
... one thing everywhere - take the character out, or ask for ...
after: ... which holds the character "<" - Windows refuses that character
... one thing everywhere. Take the character out, or ask for ...
Shown to the owner as the diff of every changed sentence before any of it was
committed, and accepted there.
One stored screen moved with it, generate-empty, by one line: the refusal about
asking for zero files. The picture was looked at rather than regenerated and
waved through - the message sits under its box, the box carries its red edge,
and nothing else on the screen shifted.
core.ErrTooManyFiles is now built from the two parts rather than beside them,
so the sentence the command line prints for --count and the parts the report
carries cannot come to disagree. Its other caller is untouched and says what it
always said.
return format.Descriptor{}, &RecipeError{Setting: SettingID, Detail: "a target has no id: every target needs a stable id, it anchors the seed and links to the manifest"}
Because: "every target needs a stable id, it anchors the seed and links to the manifest"}
214
216
}
215
217
ifseen[t.ID] {
216
-
return format.Descriptor{}, &RecipeError{Setting: SettingID, Detail: fmt.Sprintf("target id %q is used twice: ids identify targets, so a duplicate is an error rather than a silent overwrite", t.ID)}
returnnil, &RecipeError{Setting: SettingOutDir, Detail: "the output directory is empty: name a directory, for example ./fixtures, or leave it out to use the current one"}
306
+
returnnil, &RecipeError{Setting: SettingOutDir,
307
+
Detail: "the output directory is empty",
308
+
Remedy: "Name a directory, for example ./fixtures, or leave it out to use the current one"}
"the output directory %s is a file, not a directory. Point the output directory at a directory, or at one that does not exist yet and it will be created",
476
-
opt.OutDir)}
484
+
return&RecipeError{Setting: SettingOutDir,
485
+
Detail: fmt.Sprintf("the output directory %s is a file, not a directory", opt.OutDir),
486
+
Remedy: "Point the output directory at a directory, or at one that does not exist yet and it will be created"}
477
487
}
478
488
479
489
// The manifest is checked with the files it would describe, and leaving it
@@ -903,9 +913,9 @@ func renderName(t *Target, d format.Descriptor, index int) (string, error) {
903
913
// somebody ends up with a file called invoice_{index}.pdf rather than the
"%s produces the name %q, which is a path rather than a file name. Names stay inside the output directory, and a separator is refused on every system so that a recipe works everywhere. Choose the directory with the output setting instead",
936
-
where, name)}
944
+
return&RecipeError{Setting: setting,
945
+
Detail: fmt.Sprintf("%s produces the name %q, which is a path rather than a file name", where, name),
946
+
Because: "names stay inside the output directory, and a separator is refused on every system so that a recipe works everywhere",
947
+
Remedy: "Choose the directory with the output setting instead"}
937
948
938
949
// A colon, on every system, for the same reason as a separator.
"%s produces the name %q, which holds a colon. Windows reads that as a drive or as an alternate data stream rather than as part of the name, so the file arrives called something else or not at all. It is refused on every system so that a recipe means one thing everywhere - take the colon out, or ask for the file inside an archive where the name survives",
955
-
where, name)}
964
+
return&RecipeError{Setting: setting,
965
+
Detail: fmt.Sprintf("%s produces the name %q, which holds a colon", where, name),
966
+
Because: "Windows reads that as a drive or as an alternate data stream rather than as part of the name, so the file arrives called something else or not at all. It is refused on every system so that a recipe means one thing everywhere",
967
+
Remedy: "Take the colon out, or ask for the file inside an archive where the name survives"}
956
968
957
969
// Characters Windows will not put in a file name, refused on every system
958
970
// for the same reason as the separator and the colon above.
"%s produces the name %q, which holds %s. Windows refuses that character in a file name, so the file is not written there at all. It is refused on every system so that a recipe means one thing everywhere - take the character out, or ask for the file inside an archive where the name survives",
979
-
where, name, describeForbidden(bad))}
989
+
return&RecipeError{Setting: setting,
990
+
Detail: fmt.Sprintf("%s produces the name %q, which holds %s", where, name, describeForbidden(bad)),
991
+
Because: "Windows refuses that character in a file name, so the file is not written there at all. It is refused on every system so that a recipe means one thing everywhere",
992
+
Remedy: "Take the character out, or ask for the file inside an archive where the name survives"}
"%s produces the name %q, which names the null device on Windows rather than a file. Writing there succeeds and the bytes go nowhere, so the run would record a file that is not on the disk. It is refused on every system so that a recipe means one thing everywhere - give it an extension, nul.txt is an ordinary name, or choose another one",
1004
-
where, name)}
1015
+
return&RecipeError{Setting: setting,
1016
+
Detail: fmt.Sprintf("%s produces the name %q, which names the null device on Windows rather than a file", where, name),
1017
+
Because: "writing there succeeds and the bytes go nowhere, so the run would record a file that is not on the disk. It is refused on every system so that a recipe means one thing everywhere",
1018
+
Remedy: "Give it an extension, nul.txt is an ordinary name, or choose another one"}
"%s produces the name %q, which ends in a dot or a space. Windows stores such a name without it, so the file on disk would not be the file the manifest describes and verify would report both. Take the last character off, or ask for the file inside an archive where the name survives",
1026
-
where, name)}
1038
+
return&RecipeError{Setting: setting,
1039
+
Detail: fmt.Sprintf("%s produces the name %q, which ends in a dot or a space", where, name),
1040
+
Because: "Windows stores such a name without it, so the file on disk would not be the file the manifest describes and verify would report both",
1041
+
Remedy: "Take the last character off, or ask for the file inside an archive where the name survives"}
1027
1042
1028
1043
// Judged the same way on every system, like the separator above. Using
1029
1044
// filepath here asks the machine this build runs on, and the answer
"%s produces the absolute path %q. A recipe carries no absolute paths, because then it only works on the machine it was written on. Choose the directory with the output setting instead",
1037
-
where, name)}
1050
+
return&RecipeError{Setting: setting,
1051
+
Detail: fmt.Sprintf("%s produces the absolute path %q", where, name),
1052
+
Because: "a recipe carries no absolute paths, because then it only works on the machine it was written on",
1053
+
Remedy: "Choose the directory with the output setting instead"}
0 commit comments