@erclx/canon 4.24.0 → 4.24.1
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.
|
@@ -58,7 +58,7 @@ A span anywhere in the bullet has to survive all of these:
|
|
|
58
58
|
| No whitespace, `<`, `>`, `$`, `*`, `\|`, `?`, `^` | A backticked command, a placeholder, a glob, a pattern |
|
|
59
59
|
| No `://` and no leading `/`, `~`, `@`, `#`, `!` | A URL, an absolute path, a module alias |
|
|
60
60
|
| Contains `/` | A bare filename with no folder around it |
|
|
61
|
-
|
|
|
61
|
+
| Not a dotted-decimal segment, or ends with `/` | A dotted number such as an address |
|
|
62
62
|
| Not a single top-level folder | `src/`, which nobody claims to have rewritten whole |
|
|
63
63
|
| A `file:line` span leads its bullet | A citation into a file the bullet is describing |
|
|
64
64
|
| The region carries no no-change marker | A bullet recording a file it deliberately left alone |
|
package/package.json
CHANGED
package/src/pr/paths.ts
CHANGED
|
@@ -94,15 +94,18 @@ function isNotRepositoryPath(span: string): boolean {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
|
-
* Whether the span's last segment
|
|
97
|
+
* Whether the span's last segment is a bare dotted-decimal number, such as
|
|
98
|
+
* an address (`127.0.0.1`) or an unprefixed version number (`1.2.3`).
|
|
98
99
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* `src/serve/127.0.0.1` in a report over a body that was correct
|
|
100
|
+
* This is the one exclusion `resolveSpan` still applies to a non-directory
|
|
101
|
+
* span. A bare dotted number reaching the comparison is the shape that put
|
|
102
|
+
* `src/serve/127.0.0.1` in a report over a body that was correct, and every
|
|
103
|
+
* other segment carrying no extension, such as `.husky/post-merge`, now
|
|
104
|
+
* resolves.
|
|
102
105
|
*/
|
|
103
|
-
function
|
|
106
|
+
function isDottedNumber(span: string): boolean {
|
|
104
107
|
const segment = span.slice(span.lastIndexOf('/') + 1)
|
|
105
|
-
return
|
|
108
|
+
return /^\d+(?:\.\d+)+$/.test(segment)
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
/** Blanks every backticked span so a cue search never fires inside one. */
|
|
@@ -285,7 +288,7 @@ function resolveSpan(span: string): ResolvedSpan | undefined {
|
|
|
285
288
|
: { path: span, directory: true }
|
|
286
289
|
}
|
|
287
290
|
|
|
288
|
-
return
|
|
291
|
+
return isDottedNumber(span) ? undefined : { path: span, directory: false }
|
|
289
292
|
}
|
|
290
293
|
|
|
291
294
|
/**
|