dirsql 0.3.86__tar.gz → 0.3.88__tar.gz
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.
- {dirsql-0.3.86 → dirsql-0.3.88}/Cargo.lock +1 -1
- {dirsql-0.3.86 → dirsql-0.3.88}/PKG-INFO +1 -1
- {dirsql-0.3.86/packages/rust → dirsql-0.3.88}/docs/reference/hooks.md +1 -2
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/Cargo.toml +1 -1
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/reference/hooks.md +1 -2
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/e2e-attestation.json +2 -2
- {dirsql-0.3.86 → dirsql-0.3.88/packages/rust}/docs/reference/hooks.md +1 -2
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/command.rs +10 -63
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/lib.rs +26 -9
- {dirsql-0.3.86 → dirsql-0.3.88}/Cargo.toml +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/README.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/__init__.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/_async.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/_dirsql.pyi +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/cli/__init__.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/cli/binary_path.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/cli/is_windows.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/cli/main.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/cli/resolve_config_extensions.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/py.typed +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/resolve_config_extensions.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/dirsql/resolve_extension.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/.claude/CLAUDE.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/.vitepress/config.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/.vitepress/theme/index.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/.vitepress/theme/lang.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/AGENTS.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/explanation.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/getting-started.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/columns-from-paths.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/define-tables.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/embed.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/extract-from-contents.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/load-extension.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/persist.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/react-to-changes.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/search-by-meaning.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/howto/skip-files.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/index.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/migrations.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/package.json +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/playwright.config.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/pnpm-lock.yaml +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/pnpm-workspace.yaml +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/reference/cli.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/reference/columns.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/reference/config.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/reference/http-api.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/reference/sdk.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/tests/integration/home.spec.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/tests/integration/language-flag.spec.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/tests/integration/sidebar.spec.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/tests/unit/config.test.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/tests/unit/lang.test.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/docs/vitest.config.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/README.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/conftest.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/.claude/CLAUDE.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/.vitepress/config.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/.vitepress/theme/index.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/.vitepress/theme/lang.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/AGENTS.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/explanation.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/getting-started.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/columns-from-paths.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/define-tables.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/embed.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/extract-from-contents.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/load-extension.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/persist.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/react-to-changes.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/search-by-meaning.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/howto/skip-files.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/index.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/migrations.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/package.json +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/playwright.config.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/pnpm-lock.yaml +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/pnpm-workspace.yaml +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/reference/cli.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/reference/columns.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/reference/config.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/reference/http-api.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/reference/sdk.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/tests/integration/home.spec.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/tests/integration/language-flag.spec.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/tests/integration/sidebar.spec.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/tests/unit/config.test.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/tests/unit/lang.test.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/vitest.config.ts +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/src/lib.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/tests/__init__.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/tests/conftest.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/tests/e2e/__init__.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/tests/integration/__init__.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/tests/integration/binding/__init__.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/python/tests/integration/hermetic/__init__.py +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/Cargo.toml +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/README.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/benches/db_bench.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/benches/differ_bench.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/benches/matcher_bench.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/benches/scanner_bench.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/explanation.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/getting-started.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/columns-from-paths.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/define-tables.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/embed.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/extract-from-contents.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/load-extension.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/persist.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/react-to-changes.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/search-by-meaning.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/howto/skip-files.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/index.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/migrations.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/reference/cli.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/reference/columns.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/reference/config.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/reference/http-api.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/docs/reference/sdk.md +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/bin/dirsql.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/cli/execute.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/cli/init.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/cli/mod.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/cli/router.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/cli/serialize.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/cli/server.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/config.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/db.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/default_config.toml +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/differ.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/matcher.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/persist.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/scanner.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/packages/rust/src/watcher.rs +0 -0
- {dirsql-0.3.86 → dirsql-0.3.88}/pyproject.toml +0 -0
|
@@ -101,8 +101,7 @@ row-mapping rules.
|
|
|
101
101
|
|
|
102
102
|
| Placeholder | Value |
|
|
103
103
|
|---|---|
|
|
104
|
-
| `{path}` | The matched file's path **relative to the index root**.
|
|
105
|
-
| `{abspath}` | The matched file's absolute path. |
|
|
104
|
+
| `{path}` | The matched file's path **relative to the index root**. `on-file = "extract.py {path}"` |
|
|
106
105
|
| `{root}` | The index root directory. |
|
|
107
106
|
|
|
108
107
|
### `pre-query`
|
|
@@ -4,7 +4,7 @@ name = "dirsql-py-ext"
|
|
|
4
4
|
# pypi/maturin handler can rewrite it via `write-version` before
|
|
5
5
|
# `maturin build`. `pyproject.toml` declares `dynamic = ["version"]`
|
|
6
6
|
# and maturin reads this field. Mirrors `packages/rust/Cargo.toml`.
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.88"
|
|
8
8
|
# abi3 note: the `abi3-py311` pyo3 feature (below) builds ONE stable-ABI
|
|
9
9
|
# `cp311-abi3` wheel per platform that loads on every CPython >= 3.11
|
|
10
10
|
# (matching `pyproject.toml`'s `requires-python = ">=3.11"`), instead of
|
|
@@ -101,8 +101,7 @@ row-mapping rules.
|
|
|
101
101
|
|
|
102
102
|
| Placeholder | Value |
|
|
103
103
|
|---|---|
|
|
104
|
-
| `{path}` | The matched file's path **relative to the index root**.
|
|
105
|
-
| `{abspath}` | The matched file's absolute path. |
|
|
104
|
+
| `{path}` | The matched file's path **relative to the index root**. `on-file = "extract.py {path}"` |
|
|
106
105
|
| `{root}` | The index root directory. |
|
|
107
106
|
|
|
108
107
|
### `pre-query`
|
|
@@ -101,8 +101,7 @@ row-mapping rules.
|
|
|
101
101
|
|
|
102
102
|
| Placeholder | Value |
|
|
103
103
|
|---|---|
|
|
104
|
-
| `{path}` | The matched file's path **relative to the index root**.
|
|
105
|
-
| `{abspath}` | The matched file's absolute path. |
|
|
104
|
+
| `{path}` | The matched file's path **relative to the index root**. `on-file = "extract.py {path}"` |
|
|
106
105
|
| `{root}` | The index root directory. |
|
|
107
106
|
|
|
108
107
|
### `pre-query`
|
|
@@ -9,15 +9,12 @@
|
|
|
9
9
|
//! single argument — but no shell is ever invoked: there is no globbing,
|
|
10
10
|
//! piping, or variable expansion. To get a real shell, ask for one
|
|
11
11
|
//! explicitly (`sh -c '…'`).
|
|
12
|
-
//! - **Placeholders.** `{path}`, `{args}`, `{
|
|
12
|
+
//! - **Placeholders.** `{path}`, `{args}`, `{root}` (and any
|
|
13
13
|
//! others a caller supplies) are substituted into whole argv tokens, every
|
|
14
14
|
//! occurrence. Substitution is single-pass and left-to-right per token, so a
|
|
15
15
|
//! value that itself contains `{…}` is never re-scanned — a substituted value
|
|
16
16
|
//! is always exactly one argv element, keeping values with spaces (and
|
|
17
17
|
//! untrusted input) injection-safe. An unknown `{…}` is left literal.
|
|
18
|
-
//! - **append-if-absent.** A [`Placeholder`] marked [`Placeholder::append`] is
|
|
19
|
-
//! appended as a final argv element when its `{name}` does not appear in the
|
|
20
|
-
//! template (the `on-file` ergonomic: `cmd {path}` and `cmd` behave the same).
|
|
21
18
|
//! - **cwd / env / timeout.** The child runs in `cwd` (the config file's
|
|
22
19
|
//! directory), inherits dirsql's environment (so `uvx --with …` / `npx …`
|
|
23
20
|
//! dependency resolution works), and is killed if it exceeds `timeout`.
|
|
@@ -44,34 +41,21 @@ pub const DEFAULT_COMMAND_TIMEOUT: Duration = Duration::from_secs(30);
|
|
|
44
41
|
/// A named placeholder substituted into a command's argv.
|
|
45
42
|
///
|
|
46
43
|
/// `name` is the bare identifier (no braces): a `name` of `path` matches the
|
|
47
|
-
/// template token `{path}`.
|
|
44
|
+
/// template token `{path}`. Substitution only — a placeholder whose `{name}`
|
|
45
|
+
/// never appears in the template is a no-op.
|
|
48
46
|
#[derive(Debug, Clone)]
|
|
49
47
|
pub struct Placeholder {
|
|
50
48
|
pub name: String,
|
|
51
49
|
pub value: String,
|
|
52
|
-
/// When `true` and the template contains no `{name}`, `value` is appended
|
|
53
|
-
/// as a final argv element instead of being dropped.
|
|
54
|
-
pub append_if_absent: bool,
|
|
55
50
|
}
|
|
56
51
|
|
|
57
52
|
impl Placeholder {
|
|
58
|
-
///
|
|
59
|
-
///
|
|
53
|
+
/// Replaces `{name}` where it appears, and is a no-op when the template
|
|
54
|
+
/// omits it.
|
|
60
55
|
pub fn new(name: impl Into<String>, value: impl Into<String>) -> Self {
|
|
61
56
|
Self {
|
|
62
57
|
name: name.into(),
|
|
63
58
|
value: value.into(),
|
|
64
|
-
append_if_absent: false,
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/// A placeholder that is *appended* to argv when the template omits its
|
|
69
|
-
/// `{name}` (the `on-file` `{path}` ergonomic).
|
|
70
|
-
pub fn append(name: impl Into<String>, value: impl Into<String>) -> Self {
|
|
71
|
-
Self {
|
|
72
|
-
name: name.into(),
|
|
73
|
-
value: value.into(),
|
|
74
|
-
append_if_absent: true,
|
|
75
59
|
}
|
|
76
60
|
}
|
|
77
61
|
}
|
|
@@ -246,32 +230,23 @@ fn build_argv(command: &str, placeholders: &[Placeholder]) -> Result<Vec<String>
|
|
|
246
230
|
return Err(CommandError::InvalidCommand(command.to_string()));
|
|
247
231
|
}
|
|
248
232
|
|
|
249
|
-
let
|
|
250
|
-
let mut argv: Vec<String> = tokens
|
|
233
|
+
let argv: Vec<String> = tokens
|
|
251
234
|
.iter()
|
|
252
|
-
.map(|token| substitute(token, placeholders
|
|
235
|
+
.map(|token| substitute(token, placeholders))
|
|
253
236
|
.collect();
|
|
254
237
|
|
|
255
|
-
for (i, ph) in placeholders.iter().enumerate() {
|
|
256
|
-
if ph.append_if_absent && !used[i] {
|
|
257
|
-
argv.push(ph.value.clone());
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
238
|
Ok(argv)
|
|
262
239
|
}
|
|
263
240
|
|
|
264
241
|
/// Replace every `{name}` in `token` with its placeholder value in a single
|
|
265
242
|
/// left-to-right pass. Injected values are never re-scanned, so an untrusted
|
|
266
243
|
/// value containing `{…}` is inert. Unknown `{…}` sequences are left literal.
|
|
267
|
-
|
|
268
|
-
fn substitute(token: &str, placeholders: &[Placeholder], used: &mut [bool]) -> String {
|
|
244
|
+
fn substitute(token: &str, placeholders: &[Placeholder]) -> String {
|
|
269
245
|
let mut out = String::with_capacity(token.len());
|
|
270
246
|
let mut i = 0;
|
|
271
247
|
while i < token.len() {
|
|
272
248
|
if let Some((idx, consumed)) = match_placeholder(token, i, placeholders) {
|
|
273
249
|
out.push_str(&placeholders[idx].value);
|
|
274
|
-
used[idx] = true;
|
|
275
250
|
i += consumed;
|
|
276
251
|
continue;
|
|
277
252
|
}
|
|
@@ -417,30 +392,8 @@ mod tests {
|
|
|
417
392
|
}
|
|
418
393
|
|
|
419
394
|
#[test]
|
|
420
|
-
fn
|
|
421
|
-
assert_eq!(
|
|
422
|
-
argv("extract.py", &[Placeholder::append("path", "docs/a.md")]),
|
|
423
|
-
["extract.py", "docs/a.md"]
|
|
424
|
-
);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
#[test]
|
|
428
|
-
fn append_if_absent_does_not_append_when_the_token_is_present() {
|
|
429
|
-
assert_eq!(
|
|
430
|
-
argv(
|
|
431
|
-
"extract.py --file {path}",
|
|
432
|
-
&[Placeholder::append("path", "docs/a.md")]
|
|
433
|
-
),
|
|
434
|
-
["extract.py", "--file", "docs/a.md"]
|
|
435
|
-
);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
#[test]
|
|
439
|
-
fn substitute_only_placeholder_is_dropped_when_absent() {
|
|
440
|
-
assert_eq!(
|
|
441
|
-
argv("run", &[Placeholder::new("abspath", "/tmp/x")]),
|
|
442
|
-
["run"]
|
|
443
|
-
);
|
|
395
|
+
fn a_placeholder_the_template_omits_is_dropped() {
|
|
396
|
+
assert_eq!(argv("run", &[Placeholder::new("path", "/tmp/x")]), ["run"]);
|
|
444
397
|
}
|
|
445
398
|
|
|
446
399
|
#[test]
|
|
@@ -479,12 +432,6 @@ mod tests {
|
|
|
479
432
|
assert!(tail.ends_with('x'));
|
|
480
433
|
}
|
|
481
434
|
|
|
482
|
-
#[test]
|
|
483
|
-
fn placeholder_constructors_set_append_flag() {
|
|
484
|
-
assert!(!Placeholder::new("a", "b").append_if_absent);
|
|
485
|
-
assert!(Placeholder::append("a", "b").append_if_absent);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
435
|
// The run_command tests spawn real `sh`/`echo`/`cat`. Their test code must
|
|
489
436
|
// statically reference only `super::` items (plus pure std) to satisfy the
|
|
490
437
|
// unit-lint isolation rule.
|
|
@@ -1427,10 +1427,10 @@ fn build_tables_from_config(
|
|
|
1427
1427
|
/// Run a table's `on-file` command for one matched file and parse its output
|
|
1428
1428
|
/// into rows.
|
|
1429
1429
|
///
|
|
1430
|
-
/// Placeholders: `{path}` (the file relative to `root
|
|
1431
|
-
///
|
|
1432
|
-
///
|
|
1433
|
-
///
|
|
1430
|
+
/// Placeholders: `{path}` (the file relative to `root`) and `{root}` (the
|
|
1431
|
+
/// index root). `{path}` falls back to the absolute path when the file is not
|
|
1432
|
+
/// under `root`. A template that omits a placeholder simply never receives its
|
|
1433
|
+
/// value — nothing is appended.
|
|
1434
1434
|
///
|
|
1435
1435
|
/// Per-file isolation: any failure — a spawn/exit/timeout error from
|
|
1436
1436
|
/// [`command::run_command`], or output that is not a JSON array of objects —
|
|
@@ -1450,8 +1450,7 @@ fn run_on_file(
|
|
|
1450
1450
|
.map(|p| p.to_string_lossy().into_owned())
|
|
1451
1451
|
.unwrap_or_else(|_| abs_path.to_string());
|
|
1452
1452
|
let placeholders = [
|
|
1453
|
-
Placeholder::
|
|
1454
|
-
Placeholder::new("abspath", abs_path),
|
|
1453
|
+
Placeholder::new("path", rel),
|
|
1455
1454
|
Placeholder::new("root", root.to_string_lossy().into_owned()),
|
|
1456
1455
|
];
|
|
1457
1456
|
|
|
@@ -2876,9 +2875,8 @@ mod internal_tests {
|
|
|
2876
2875
|
fn run_on_file_parses_command_json_output() {
|
|
2877
2876
|
let dir = TempDir::new().unwrap();
|
|
2878
2877
|
let abs = dir.path().join("f.txt");
|
|
2879
|
-
//
|
|
2880
|
-
//
|
|
2881
|
-
// keeping the JSON payload clean.
|
|
2878
|
+
// The template omits every placeholder, so nothing is appended; the
|
|
2879
|
+
// `printf` payload is the whole output.
|
|
2882
2880
|
let rows = run_on_file(
|
|
2883
2881
|
"printf '[{\"n\":1}]'",
|
|
2884
2882
|
&abs.to_string_lossy(),
|
|
@@ -2890,6 +2888,25 @@ mod internal_tests {
|
|
|
2890
2888
|
assert_eq!(rows[0]["n"], Value::Integer(1));
|
|
2891
2889
|
}
|
|
2892
2890
|
|
|
2891
|
+
/// `{abspath}` is not in the substitution table: it is left literal like any
|
|
2892
|
+
/// unknown `{…}`, so `printf` receives the string `{abspath}` verbatim. The
|
|
2893
|
+
/// template references `{path}` so that arg is the real path (and no path is
|
|
2894
|
+
/// appended), isolating the `{abspath}` behavior in the `q` column.
|
|
2895
|
+
#[test]
|
|
2896
|
+
fn run_on_file_does_not_substitute_abspath() {
|
|
2897
|
+
let dir = TempDir::new().unwrap();
|
|
2898
|
+
let abs = dir.path().join("f.txt");
|
|
2899
|
+
let rows = run_on_file(
|
|
2900
|
+
r#"printf '[{"p":"%s","q":"%s"}]' {path} {abspath}"#,
|
|
2901
|
+
&abs.to_string_lossy(),
|
|
2902
|
+
dir.path(),
|
|
2903
|
+
dir.path(),
|
|
2904
|
+
command::DEFAULT_COMMAND_TIMEOUT,
|
|
2905
|
+
);
|
|
2906
|
+
assert_eq!(rows.len(), 1);
|
|
2907
|
+
assert_eq!(rows[0]["q"], Value::Text("{abspath}".into()));
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2893
2910
|
/// A command that cannot be spawned yields no rows (per-file isolation).
|
|
2894
2911
|
#[test]
|
|
2895
2912
|
fn run_on_file_returns_no_rows_on_spawn_failure() {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dirsql-0.3.86 → dirsql-0.3.88}/packages/python/docs/tests/integration/language-flag.spec.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|