edf2csv 0.5.117 → 0.5.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,69 @@
3
3
  Notable changes to edf2csv. Versions follow [semantic versioning](https://semver.org); while the
4
4
  major version is 0, a minor bump may contain breaking changes.
5
5
 
6
+ ## 0.5.119
7
+
8
+ ### Fixed: a paragraph written into the middle of a quoted warning
9
+
10
+ The `CONTINUOUS_LIAR` entry in warnings-and-errors quotes what the run prints. What the page
11
+ showed was this:
12
+
13
+ ```
14
+ warning: This file is marked continuous (EDF+C), but 2 of its 3 data records say they start
15
+ somewhere other than where continuity puts them.
16
+
17
+ A BDF+ file gets its own spelling — `BDF+C` and `BDF+D` — the same as the discontinuous entry
18
+ above. Until 0.5.105 this half of the code printed the EDF markers whatever the format, so a
19
+ BDF+ recording was told about a string it does not contain and pointed at a marker BDF+ does
20
+ not define.
21
+ Times are written as if the records were contiguous, which is what EDF+C means.
22
+ If the recording really has gaps, the file should have been marked EDF+D.
23
+ ```
24
+
25
+ An English sentence, backticks and all, inside the code block, between the warning and its own
26
+ advice — so the two indented lines read as hanging off the paragraph rather than off the
27
+ warning, and the warning itself reads as ending mid-sentence. The paragraph is true and belongs
28
+ on the page; it is now below the block instead of inside it.
29
+
30
+ A hint is joined to its message by nothing but that indent. So an indented line in a quoted
31
+ diagnostic has to have a diagnostic directly above it, and a test now holds every such block on
32
+ every page to that. A blank line inside one is still fine — the mixed-rate example shows a
33
+ warning, a blank line and then the closing summary, which is exactly what that run prints.
34
+
35
+ ## 0.5.118
36
+
37
+ ### Fixed: one failed write, two error lines, and the second one wrong about it
38
+
39
+ `edf2csv wide.edf --info > desc.txt` onto a filesystem with no room:
40
+
41
+ ```
42
+ error: Writing to stdout failed: ENOSPC: no space left on device, write
43
+ error: Writing to stdout failed: 58900 of 58900 bytes did not reach the destination, which
44
+ stopped accepting them part way through.
45
+ What is there ends mid-row and should not be used. ... and nothing after it raised an
46
+ error because there was nothing after it.
47
+ ```
48
+
49
+ Three of the second message's claims are false of what happened. Nothing was accepted, so the
50
+ destination did not stop part way through. The file is empty, so nothing "is there" and nothing
51
+ ends mid-row — and a description is a table, which has no rows to end mid-. And something after
52
+ it did raise an error: the line printed directly above.
53
+
54
+ The stdout audit exists for the one failure nothing else reports, a write that is accepted and
55
+ silently truncated. When the stream itself has already errored there is nothing left for it to
56
+ add, and it now says nothing. When it does speak and nothing landed at all, it says so rather
57
+ than describing a short write.
58
+
59
+ ### Fixed: and then that failure exited 0
60
+
61
+ With the audit silent the run exited 0 — the error printed, the file zero bytes, and success
62
+ reported. The stdout listener sets the failing exit code, and the entry point assigned `main`'s
63
+ 0 straight over it; the audit's second error was the only thing that had been making the run
64
+ fail. A code already set by a reported write failure now survives a run that returns 0.
65
+
66
+ A closed pipe still exits 0: that path deliberately sets no code, which is what makes
67
+ `--info | head` an ordinary thing to do rather than a failure.
68
+
6
69
  ## 0.5.117
7
70
 
8
71
  ### Fixed: the recipes page loaded a file the example recording never writes
package/dist/cli.js CHANGED
@@ -1694,7 +1694,19 @@ const invokedDirectly = isMainModule();
1694
1694
  if (invokedDirectly) {
1695
1695
  main(process.argv.slice(2))
1696
1696
  .then((code) => {
1697
- process.exitCode = code;
1697
+ /*
1698
+ A write failure already reported is not erased by a run that thought it finished.
1699
+
1700
+ The stdout listener above prints `Writing to stdout failed: ...` and sets EXIT_ERROR,
1701
+ and assigning `code` over it put that back to 0 — so `--info > desc.txt` onto a full
1702
+ filesystem printed the error, left a zero-byte file, and exited 0. It only looked
1703
+ right because the stdout audit threw a second error on the way out, whose message was
1704
+ about a short write that had not happened.
1705
+
1706
+ A closed pipe deliberately sets no code (see ignoreBrokenPipe), so `--info | head`
1707
+ still exits 0 through here.
1708
+ */
1709
+ process.exitCode = code === EXIT_OK ? (process.exitCode ?? EXIT_OK) : code;
1698
1710
  })
1699
1711
  .catch((error) => {
1700
1712
  process.stderr.write(`error: ${message(error)}\n`);