turbo-editors/turbo-pythonpublic Fork 0
8d00593
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-python.git
git clone ssh://git@rickub.com/turbo-editors/turbo-python.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

📦 Turbo Python

k33g committed 2026-09-20T09:28:34+02:00 Browse files
8d00593 parent: bbfc62f
added .memory/handoffs/2026-09-20-load-config.md +17 -0
new file mode 100644
@@ -0,0 +1,17 @@
1+# Handoff — 2026-09-20 — `-load-config` (needs turbo-core v1.0.3)
2+
3+## State
4+
5+- `-load-config <url>` wired in `main.go`, three tests in `main_test.go`, docs EN+FR updated. Green under the umbrella `go.work` (`turbo-editors/`), which resolves turbo-core to the local checkout.
6+- **`go.mod` still says turbo-core v1.0.2** — `GOWORK=off make check` fails until turbo-core v1.0.3 is tagged and this is re-pinned. Even under the workspace, the two release-script tests (`TestTheTagScript…`) fail for the same reason: they build a copy of the module outside it. Everything else is green.
7+
8+## Next steps
9+
10+1. When turbo-core v1.0.3 is tagged: `go get rickub.com/turbo-editors/turbo-core@v1.0.3 && go mod tidy && GOWORK=off make check`.
11+2. Try it for real: in an empty directory, `turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init` (the sample repository holds `.turbo-go` only — for this editor a directory with a `.turbo-python` is needed), then start `turbo-python` and check the settings took.
12+3. Then `./01-release.tag.sh` as usual.
13+
14+## Traps
15+
16+- The sample configs repository is `rickub.com/turbo-editors/configs`; its git address is `git.rickub.com`, which `configrepo` tries second. A wrong first candidate costs one `ls-remote`, not the load.
17+- The editor refuses when `.turbo-python` already exists (`configrepo.ErrExists`); there is deliberately no `--force`.
new file mode 100644
@@ -0,0 +1,17 @@
1+# Handoff — 2026-09-20 — `-load-config` (needs turbo-core v1.0.3)
2+
3+## State
4+
5+- `-load-config <url>` wired in `main.go`, three tests in `main_test.go`, docs EN+FR updated. Green under the umbrella `go.work` (`turbo-editors/`), which resolves turbo-core to the local checkout.
6+- **`go.mod` still says turbo-core v1.0.2** — `GOWORK=off make check` fails until turbo-core v1.0.3 is tagged and this is re-pinned. Even under the workspace, the two release-script tests (`TestTheTagScript…`) fail for the same reason: they build a copy of the module outside it. Everything else is green.
7+
8+## Next steps
9+
10+1. When turbo-core v1.0.3 is tagged: `go get rickub.com/turbo-editors/turbo-core@v1.0.3 && go mod tidy && GOWORK=off make check`.
11+2. Try it for real: in an empty directory, `turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init` (the sample repository holds `.turbo-go` only — for this editor a directory with a `.turbo-python` is needed), then start `turbo-python` and check the settings took.
12+3. Then `./01-release.tag.sh` as usual.
13+
14+## Traps
15+
16+- The sample configs repository is `rickub.com/turbo-editors/configs`; its git address is `git.rickub.com`, which `configrepo` tries second. A wrong first candidate costs one `ls-remote`, not the load.
17+- The editor refuses when `.turbo-python` already exists (`configrepo.ErrExists`); there is deliberately no `--force`.
modified .memory/history.md +9 -0
@@ -102,3 +102,12 @@ One dated entry per session, appended. Never rewritten.
102102 - **Changes, release tooling**: `.github/workflows/release.yml` (new), `01-release.tag.sh` (rewritten), `03-build-releases.sh` → `02-build-releases.sh` (tag from `$1`, validation, `replace` check, fresh `release/${TAG}/`, `go install` line in the README, no hand-off to 04), `02-release.publish.sh` and `04-release.upload-binaries.sh` deleted, `release.env` rewritten (`TAG="v1.0.0"`, `ABOUT="Turbo Python"`). All generated from turbo-go's final files with the names substituted; the README paragraph naming this editor's language server and the example file (`main.py`) kept from the old 03. Docs: the release section and the wrong-commit variant of `docs/{en,fr}/how-to/make-a-release.md` rewritten.
103103 - **Tests**: `release_test.go` regenerated from turbo-go's — see `summary.md`. The file-writing helper is `writeTestFile` because turbo-python's `main_test.go` owns `writeFile`, and the command helper `runOrFail` because `main.go` owns `run`.
104104 - **Not done**: nothing committed or pushed — no commit exists yet and `origin` is unreachable from the sandbox. The workflow has not run on Rickub for this editor; turbo-go's identical one has, and published.
105+
106+## 2026-09-20 — `-load-config <url>`: a shared `.turbo-python` fetched from a repository
107+
108+- **Asked** (umbrella session, ticket #25 of `turbo-editors/.tickets`): `turbo-python --load-config <forge URL>` fetches the `.turbo-python` found at that directory of the repository and copies it into the working directory; the same for every Turbo editor with its own directory name.
109+- **Changes**: `main.go` — `loadConfig` option and flag, `case opts.loadConfig != ""` in `run`, `loadConfig` and `describeLoad`; the work itself is turbo-core's new `configrepo` package (git ls-remote + shallow clone; rickub, GitHub, GitLab, Codeberg URLs). `main_test.go` — three tests (`describeLoad` ×2, `loadConfig` refuses when `.turbo-python` exists, no network needed). Docs: `docs/{en,fr}/reference/cli.md` (flag, example, files, errors), `docs/{en,fr}/how-to/configure-a-project.md` (new section).
110+- **Depends on turbo-core v1.0.3**, not yet tagged: `go.mod` still pins v1.0.2, so this builds only under the umbrella `go.work` (`turbo-editors/README.md` explains) until `go get rickub.com/turbo-editors/turbo-core@v1.0.3 && go mod tidy`. Verified with `make check` under that workspace.
111+- **Not done**: not committed; go.mod not re-pinned; not run against a real terminal.
112+- **Correction, same session**: under the workspace everything passes **except `TestTheTagScriptTagsAndPushesForReal` and `TestTheTagScriptRefusesATagItAlreadyPublished`** — they copy the module elsewhere and run `make check` there, outside the workspace, where turbo-core v1.0.2 from the proxy has no `configrepo`. They go green the moment `go.mod` is re-pinned to v1.0.3. The package diagram (`docs/diagrams/packages.drawio`, where the module has one) gained a `configrepo` box and a `main → configrepo` arrow, which its own test demanded.
113+
@@ -102,3 +102,12 @@ One dated entry per session, appended. Never rewritten.
102 - **Changes, release tooling**: `.github/workflows/release.yml` (new), `01-release.tag.sh` (rewritten), `03-build-releases.sh` → `02-build-releases.sh` (tag from `$1`, validation, `replace` check, fresh `release/${TAG}/`, `go install` line in the README, no hand-off to 04), `02-release.publish.sh` and `04-release.upload-binaries.sh` deleted, `release.env` rewritten (`TAG="v1.0.0"`, `ABOUT="Turbo Python"`). All generated from turbo-go's final files with the names substituted; the README paragraph naming this editor's language server and the example file (`main.py`) kept from the old 03. Docs: the release section and the wrong-commit variant of `docs/{en,fr}/how-to/make-a-release.md` rewritten.102 - **Changes, release tooling**: `.github/workflows/release.yml` (new), `01-release.tag.sh` (rewritten), `03-build-releases.sh` → `02-build-releases.sh` (tag from `$1`, validation, `replace` check, fresh `release/${TAG}/`, `go install` line in the README, no hand-off to 04), `02-release.publish.sh` and `04-release.upload-binaries.sh` deleted, `release.env` rewritten (`TAG="v1.0.0"`, `ABOUT="Turbo Python"`). All generated from turbo-go's final files with the names substituted; the README paragraph naming this editor's language server and the example file (`main.py`) kept from the old 03. Docs: the release section and the wrong-commit variant of `docs/{en,fr}/how-to/make-a-release.md` rewritten.
103 - **Tests**: `release_test.go` regenerated from turbo-go's — see `summary.md`. The file-writing helper is `writeTestFile` because turbo-python's `main_test.go` owns `writeFile`, and the command helper `runOrFail` because `main.go` owns `run`.103 - **Tests**: `release_test.go` regenerated from turbo-go's — see `summary.md`. The file-writing helper is `writeTestFile` because turbo-python's `main_test.go` owns `writeFile`, and the command helper `runOrFail` because `main.go` owns `run`.
104 - **Not done**: nothing committed or pushed — no commit exists yet and `origin` is unreachable from the sandbox. The workflow has not run on Rickub for this editor; turbo-go's identical one has, and published.104 - **Not done**: nothing committed or pushed — no commit exists yet and `origin` is unreachable from the sandbox. The workflow has not run on Rickub for this editor; turbo-go's identical one has, and published.
105+
106+## 2026-09-20 — `-load-config <url>`: a shared `.turbo-python` fetched from a repository
107+
108+- **Asked** (umbrella session, ticket #25 of `turbo-editors/.tickets`): `turbo-python --load-config <forge URL>` fetches the `.turbo-python` found at that directory of the repository and copies it into the working directory; the same for every Turbo editor with its own directory name.
109+- **Changes**: `main.go` — `loadConfig` option and flag, `case opts.loadConfig != ""` in `run`, `loadConfig` and `describeLoad`; the work itself is turbo-core's new `configrepo` package (git ls-remote + shallow clone; rickub, GitHub, GitLab, Codeberg URLs). `main_test.go` — three tests (`describeLoad` ×2, `loadConfig` refuses when `.turbo-python` exists, no network needed). Docs: `docs/{en,fr}/reference/cli.md` (flag, example, files, errors), `docs/{en,fr}/how-to/configure-a-project.md` (new section).
110+- **Depends on turbo-core v1.0.3**, not yet tagged: `go.mod` still pins v1.0.2, so this builds only under the umbrella `go.work` (`turbo-editors/README.md` explains) until `go get rickub.com/turbo-editors/turbo-core@v1.0.3 && go mod tidy`. Verified with `make check` under that workspace.
111+- **Not done**: not committed; go.mod not re-pinned; not run against a real terminal.
112+- **Correction, same session**: under the workspace everything passes **except `TestTheTagScriptTagsAndPushesForReal` and `TestTheTagScriptRefusesATagItAlreadyPublished`** — they copy the module elsewhere and run `make check` there, outside the workspace, where turbo-core v1.0.2 from the proxy has no `configrepo`. They go green the moment `go.mod` is re-pinned to v1.0.3. The package diagram (`docs/diagrams/packages.drawio`, where the module has one) gained a `configrepo` box and a `main → configrepo` arrow, which its own test demanded.
113+
modified .memory/summary.md +5 -0
@@ -141,3 +141,8 @@ while testing the published library instead of your changes, so run that second
141141 - **Module path `rickub.com/turbo-editors/turbo-python`**, depending on `rickub.com/turbo-editors/turbo-core v1.0.0` — the first turbo-core version published under that path (`v0.9.0` on the proxy still declares the Codeberg path and cannot be required as `rickub.com/…`). Every import, the Makefile's `VERSION_PKG`, `scripts/install.sh`, the README and the docs say `rickub.com`. `GOWORK=off make check` green. The repository on this side is a fresh `git init` with `origin` at `ssh://git@rickub.com/turbo-editors/turbo-python.git` and **no commit yet**; `01-release.tag.sh` makes the first one.
142142 - **Releases are one script and one workflow**, modelled on turbo-core's and identical to turbo-go's. `01-release.tag.sh` runs `make check` under `TURBO_PYTHON_RELEASING=1`, refuses a tag taken locally or on origin (bump, never move), refuses a `replace` in `go.mod`, commits, pushes the current branch, then tags and pushes the tag. That push starts `.github/workflows/release.yml`: `go test` with `TURBO_PYTHON_RELEASING=1`, `./02-build-releases.sh "${GITHUB_REF_NAME}"`, release notes from the tag message, a run artifact, then `softprops/action-gh-release@v2` attaching `turbo-python-*`, `SHA256SUMS` and `README.md` with the job's own `GITHUB_TOKEN` — the only credential Rickub's release API accepts. **`02-release.publish.sh` and `04-release.upload-binaries.sh` are gone**; the build script is now `02-build-releases.sh`, takes the tag as `$1` (CI has no `release.env`), validates it, refuses a `replace`, and starts from an empty `release/${TAG}/`. `release.env` holds only `TAG` and `ABOUT`; `turbo-python.token.env` is read by nothing.
143143 - **`release_test.go`** runs `01` for real against a throwaway bare remote (publishes, then refuses the same tag), runs `02` alone to see it refuse `v0.o.0`, and asserts the workflow's trigger, `contents: write`, `./02-build-releases.sh`, `fail_on_unmatched_files`, docs linked at the tag, no `secrets.`, and `TURBO_PYTHON_RELEASING`. The copy of the module for the clone leaves out `.git`, `bin`, `release`, `kits`, `demo`, `demos`, `*.env` and `go.work*`; children run with `GOWORK=off`.
144+
145+## State as of 2026-09-20
146+
147+- **`-load-config <url>` is wired** (`main.go`: `loadConfig`, `describeLoad`), on top of turbo-core's `configrepo`. It needs **turbo-core v1.0.3**, which is not tagged yet; `go.mod` pins v1.0.2, so the editor builds only under the umbrella `go.work` until re-pinned. A project with a `.turbo-python` already is refused, not overwritten.
148+
@@ -141,3 +141,8 @@ while testing the published library instead of your changes, so run that second
141 - **Module path `rickub.com/turbo-editors/turbo-python`**, depending on `rickub.com/turbo-editors/turbo-core v1.0.0` — the first turbo-core version published under that path (`v0.9.0` on the proxy still declares the Codeberg path and cannot be required as `rickub.com/…`). Every import, the Makefile's `VERSION_PKG`, `scripts/install.sh`, the README and the docs say `rickub.com`. `GOWORK=off make check` green. The repository on this side is a fresh `git init` with `origin` at `ssh://git@rickub.com/turbo-editors/turbo-python.git` and **no commit yet**; `01-release.tag.sh` makes the first one.141 - **Module path `rickub.com/turbo-editors/turbo-python`**, depending on `rickub.com/turbo-editors/turbo-core v1.0.0` — the first turbo-core version published under that path (`v0.9.0` on the proxy still declares the Codeberg path and cannot be required as `rickub.com/…`). Every import, the Makefile's `VERSION_PKG`, `scripts/install.sh`, the README and the docs say `rickub.com`. `GOWORK=off make check` green. The repository on this side is a fresh `git init` with `origin` at `ssh://git@rickub.com/turbo-editors/turbo-python.git` and **no commit yet**; `01-release.tag.sh` makes the first one.
142 - **Releases are one script and one workflow**, modelled on turbo-core's and identical to turbo-go's. `01-release.tag.sh` runs `make check` under `TURBO_PYTHON_RELEASING=1`, refuses a tag taken locally or on origin (bump, never move), refuses a `replace` in `go.mod`, commits, pushes the current branch, then tags and pushes the tag. That push starts `.github/workflows/release.yml`: `go test` with `TURBO_PYTHON_RELEASING=1`, `./02-build-releases.sh "${GITHUB_REF_NAME}"`, release notes from the tag message, a run artifact, then `softprops/action-gh-release@v2` attaching `turbo-python-*`, `SHA256SUMS` and `README.md` with the job's own `GITHUB_TOKEN` — the only credential Rickub's release API accepts. **`02-release.publish.sh` and `04-release.upload-binaries.sh` are gone**; the build script is now `02-build-releases.sh`, takes the tag as `$1` (CI has no `release.env`), validates it, refuses a `replace`, and starts from an empty `release/${TAG}/`. `release.env` holds only `TAG` and `ABOUT`; `turbo-python.token.env` is read by nothing.142 - **Releases are one script and one workflow**, modelled on turbo-core's and identical to turbo-go's. `01-release.tag.sh` runs `make check` under `TURBO_PYTHON_RELEASING=1`, refuses a tag taken locally or on origin (bump, never move), refuses a `replace` in `go.mod`, commits, pushes the current branch, then tags and pushes the tag. That push starts `.github/workflows/release.yml`: `go test` with `TURBO_PYTHON_RELEASING=1`, `./02-build-releases.sh "${GITHUB_REF_NAME}"`, release notes from the tag message, a run artifact, then `softprops/action-gh-release@v2` attaching `turbo-python-*`, `SHA256SUMS` and `README.md` with the job's own `GITHUB_TOKEN` — the only credential Rickub's release API accepts. **`02-release.publish.sh` and `04-release.upload-binaries.sh` are gone**; the build script is now `02-build-releases.sh`, takes the tag as `$1` (CI has no `release.env`), validates it, refuses a `replace`, and starts from an empty `release/${TAG}/`. `release.env` holds only `TAG` and `ABOUT`; `turbo-python.token.env` is read by nothing.
143 - **`release_test.go`** runs `01` for real against a throwaway bare remote (publishes, then refuses the same tag), runs `02` alone to see it refuse `v0.o.0`, and asserts the workflow's trigger, `contents: write`, `./02-build-releases.sh`, `fail_on_unmatched_files`, docs linked at the tag, no `secrets.`, and `TURBO_PYTHON_RELEASING`. The copy of the module for the clone leaves out `.git`, `bin`, `release`, `kits`, `demo`, `demos`, `*.env` and `go.work*`; children run with `GOWORK=off`.143 - **`release_test.go`** runs `01` for real against a throwaway bare remote (publishes, then refuses the same tag), runs `02` alone to see it refuse `v0.o.0`, and asserts the workflow's trigger, `contents: write`, `./02-build-releases.sh`, `fail_on_unmatched_files`, docs linked at the tag, no `secrets.`, and `TURBO_PYTHON_RELEASING`. The copy of the module for the clone leaves out `.git`, `bin`, `release`, `kits`, `demo`, `demos`, `*.env` and `go.work*`; children run with `GOWORK=off`.
144+
145+## State as of 2026-09-20
146+
147+- **`-load-config <url>` is wired** (`main.go`: `loadConfig`, `describeLoad`), on top of turbo-core's `configrepo`. It needs **turbo-core v1.0.3**, which is not tagged yet; `go.mod` pins v1.0.2, so the editor builds only under the umbrella `go.work` until re-pinned. A project with a `.turbo-python` already is refused, not overwritten.
148+
added INSTALL.MACOS.md +11 -0
new file mode 100644
@@ -0,0 +1,11 @@
1+# Install `turbo-python` on macOS
2+
3+```bash
4+# download the binary release in https://rickub.com/turbo-editors/turbo-python/releases
5+VERSION=1.0.3
6+curl -fsSLO "https://rickub.com/turbo-editors/turbo-python/releases/download/v${VERSION}/turbo-python-${VERSION}-darwin-arm64"
7+chmod +x ./turbo-python-${VERSION}-darwin-arm64
8+xattr -cr ./turbo-python-${VERSION}-darwin-arm64
9+sudo rm /usr/local/bin/turbo-python
10+sudo cp ./turbo-python-${VERSION}-darwin-arm64 /usr/local/bin/turbo-python
11+```
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,11 @@
1+# Install `turbo-python` on macOS
2+
3+```bash
4+# download the binary release in https://rickub.com/turbo-editors/turbo-python/releases
5+VERSION=1.0.3
6+curl -fsSLO "https://rickub.com/turbo-editors/turbo-python/releases/download/v${VERSION}/turbo-python-${VERSION}-darwin-arm64"
7+chmod +x ./turbo-python-${VERSION}-darwin-arm64
8+xattr -cr ./turbo-python-${VERSION}-darwin-arm64
9+sudo rm /usr/local/bin/turbo-python
10+sudo cp ./turbo-python-${VERSION}-darwin-arm64 /usr/local/bin/turbo-python
11+```
\ No newline at end of file\ No newline at end of file
modified docs/diagrams/packages.drawio +2 -0
@@ -13,6 +13,7 @@
1313 <mxCell id="8" value="&lt;b&gt;theme&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="329" y="260" width="190" height="54" as="geometry"/></mxCell>
1414 <mxCell id="9" value="&lt;b&gt;version&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="390" width="190" height="54" as="geometry"/></mxCell>
1515 <mxCell id="10" value="tcell/v2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999999;dashed=1;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="520" width="190" height="54" as="geometry"/></mxCell>
16+ <mxCell id="20" value="&lt;b&gt;configrepo&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="117" y="390" width="190" height="54" as="geometry"/></mxCell>
1617 <mxCell id="e11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="5"><mxGeometry relative="1" as="geometry"/></mxCell>
1718 <mxCell id="e12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="7"><mxGeometry relative="1" as="geometry"/></mxCell>
1819 <mxCell id="e13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="3"><mxGeometry relative="1" as="geometry"/></mxCell>
@@ -22,6 +23,7 @@
2223 <mxCell id="e17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="6"><mxGeometry relative="1" as="geometry"/></mxCell>
2324 <mxCell id="e18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>
2425 <mxCell id="e19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="9"><mxGeometry relative="1" as="geometry"/></mxCell>
26+ <mxCell id="e20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="20"><mxGeometry relative="1" as="geometry"/></mxCell>
2527 </root>
2628 </mxGraphModel>
2729 </diagram>
@@ -13,6 +13,7 @@
13 <mxCell id="8" value="&lt;b&gt;theme&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="329" y="260" width="190" height="54" as="geometry"/></mxCell>13 <mxCell id="8" value="&lt;b&gt;theme&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="329" y="260" width="190" height="54" as="geometry"/></mxCell>
14 <mxCell id="9" value="&lt;b&gt;version&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="390" width="190" height="54" as="geometry"/></mxCell>14 <mxCell id="9" value="&lt;b&gt;version&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="390" width="190" height="54" as="geometry"/></mxCell>
15 <mxCell id="10" value="tcell/v2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999999;dashed=1;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="520" width="190" height="54" as="geometry"/></mxCell>15 <mxCell id="10" value="tcell/v2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999999;dashed=1;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="520" width="190" height="54" as="geometry"/></mxCell>
16+ <mxCell id="20" value="&lt;b&gt;configrepo&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="117" y="390" width="190" height="54" as="geometry"/></mxCell>
16 <mxCell id="e11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="5"><mxGeometry relative="1" as="geometry"/></mxCell>17 <mxCell id="e11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="5"><mxGeometry relative="1" as="geometry"/></mxCell>
17 <mxCell id="e12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="7"><mxGeometry relative="1" as="geometry"/></mxCell>18 <mxCell id="e12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="7"><mxGeometry relative="1" as="geometry"/></mxCell>
18 <mxCell id="e13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="3"><mxGeometry relative="1" as="geometry"/></mxCell>19 <mxCell id="e13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="3"><mxGeometry relative="1" as="geometry"/></mxCell>
@@ -22,6 +23,7 @@
22 <mxCell id="e17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="6"><mxGeometry relative="1" as="geometry"/></mxCell>23 <mxCell id="e17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="6"><mxGeometry relative="1" as="geometry"/></mxCell>
23 <mxCell id="e18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>24 <mxCell id="e18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>
24 <mxCell id="e19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="9"><mxGeometry relative="1" as="geometry"/></mxCell>25 <mxCell id="e19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="9"><mxGeometry relative="1" as="geometry"/></mxCell>
26+ <mxCell id="e20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="20"><mxGeometry relative="1" as="geometry"/></mxCell>
25 </root>27 </root>
26 </mxGraphModel>28 </mxGraphModel>
27 </diagram>29 </diagram>
modified docs/en/how-to/configure-a-project.md +13 -0
@@ -70,6 +70,19 @@ turbo-python -theme turbo-dark main.py
7070
7171 **Options ▸ Project settings…** opens it again. It is greyed out in a project that has none.
7272
73+## Start from a shared configuration
74+
75+A team can keep ready-made configurations in a repository — one directory per kind of project, each with a `.turbo-python` inside. Point the editor at the directory, with the URL the browser shows, and it copies that `.turbo-python` into the current directory:
76+
77+```bash
78+cd my-project
79+turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init
80+```
81+
82+It prints what arrived and exits; the next `turbo-python` opens the project with those settings, snippets and tools in force. The URL may be on rickub, GitHub, GitLab or Codeberg, and may point at the directory, at the `.turbo-python` inside it, or at the repository itself for its root on the default branch. `git` must be installed: the fetch is a shallow clone.
83+
84+A project that already has a `.turbo-python` is left alone — the editor refuses rather than overwrite what the project decided. Move the directory away first if you mean to replace it.
85+
7386 ## Variants
7487
7588 - **You start the editor from a subdirectory.** The settings are not found: only `./.turbo-python` is looked at, with no walk up towards the project root. Start from the project's own directory, or pass `-theme` for that run.
@@ -70,6 +70,19 @@ turbo-python -theme turbo-dark main.py
70 70
71 **Options ▸ Project settings…** opens it again. It is greyed out in a project that has none.71 **Options ▸ Project settings…** opens it again. It is greyed out in a project that has none.
72 72
73+## Start from a shared configuration
74+
75+A team can keep ready-made configurations in a repository — one directory per kind of project, each with a `.turbo-python` inside. Point the editor at the directory, with the URL the browser shows, and it copies that `.turbo-python` into the current directory:
76+
77+```bash
78+cd my-project
79+turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init
80+```
81+
82+It prints what arrived and exits; the next `turbo-python` opens the project with those settings, snippets and tools in force. The URL may be on rickub, GitHub, GitLab or Codeberg, and may point at the directory, at the `.turbo-python` inside it, or at the repository itself for its root on the default branch. `git` must be installed: the fetch is a shallow clone.
83+
84+A project that already has a `.turbo-python` is left alone — the editor refuses rather than overwrite what the project decided. Move the directory away first if you mean to replace it.
85+
73 ## Variants86 ## Variants
74 87
75 - **You start the editor from a subdirectory.** The settings are not found: only `./.turbo-python` is looked at, with no walk up towards the project root. Start from the project's own directory, or pass `-theme` for that run.88 - **You start the editor from a subdirectory.** The settings are not found: only `./.turbo-python` is looked at, with no walk up towards the project root. Start from the project's own directory, or pass `-theme` for that run.
modified docs/en/reference/cli.md +7 -0
@@ -18,6 +18,7 @@ Each `file` is opened in its own window. A file that does not exist yet is opene
1818 | `-list-themes` | bool | `false` | Print every loadable theme with its description, then the user theme directory, and exit. |
1919 | `-no-lsp` | bool | `false` | Do not start a language server. Colouring and editing are unaffected. |
2020 | `-version` | bool | `false` | Print `Turbo Python <version>` on one line, with the commit and build date when the build recorded them, and exit. See [the version number](versioning.md). |
21+| `-load-config <url>` | string | none | Copy the `.turbo-python` directory found at a repository URL — rickub, GitHub, GitLab or Codeberg, the URL of the directory as the browser shows it — into the working directory, print what arrived, and exit. Needs `git`. Refuses when `./.turbo-python` already exists. The editor is not started. |
2122 | `-h`, `-help` | bool | `false` | Print the flag list and exit. |
2223
2324 ## Environment
@@ -34,6 +35,7 @@ Each `file` is opened in its own window. A file that does not exist yet is opene
3435 | --- | --- |
3536 | `$TURBO_PYTHON_THEME_DIR/*.toml` | User themes, when the variable is set. |
3637 | `./.turbo-python/settings.toml` | This project's settings, read once at start-up. See [project settings](project-settings.md). |
38+| `./.turbo-python/` (written) | Created by `-load-config` from a repository's copy, when the project has none yet. |
3739 | `~/.config/turbo-python/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |
3840 | `~/Library/Application Support/turbo-python/themes/*.toml` | User themes on macOS. |
3941 | `<module>/pyproject.toml` | Located by walking up from the first file; its directory becomes the language server's root. |
@@ -72,6 +74,7 @@ turbo-python main.py pyproject.toml # two windows
7274 turbo-python -theme turbo-dark main.py # a different theme
7375 turbo-python -no-lsp main.py # no language server
7476 turbo-python -list-themes # what themes exist
77+turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # start from a shared configuration
7578 ```
7679
7780 ## Installer
@@ -98,3 +101,7 @@ turbo-python -list-themes # what themes exist
98101 | `turbo-python: initialising the terminal: …` | The terminal was opened but could not be put into raw mode. |
99102 | `Cannot open` (in a dialog) | The path is a directory, or is not readable. |
100103 | `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |
104+| `turbo-python: configrepo: the project already has a configuration directory: …` | `-load-config` into a project that already has `.turbo-python`. Move it away first. |
105+| `turbo-python: configrepo: git is not installed` | `-load-config` needs the `git` command on `PATH`. |
106+| `turbo-python: configrepo: no configuration directory at that path: …` | The repository was found but holds no `.turbo-python` where the URL points. |
107+| `turbo-python: configrepo: no repository answered: …` | No clone address for that URL answered; the URL, the network, or a private repository. |
@@ -18,6 +18,7 @@ Each `file` is opened in its own window. A file that does not exist yet is opene
18 | `-list-themes` | bool | `false` | Print every loadable theme with its description, then the user theme directory, and exit. |18 | `-list-themes` | bool | `false` | Print every loadable theme with its description, then the user theme directory, and exit. |
19 | `-no-lsp` | bool | `false` | Do not start a language server. Colouring and editing are unaffected. |19 | `-no-lsp` | bool | `false` | Do not start a language server. Colouring and editing are unaffected. |
20 | `-version` | bool | `false` | Print `Turbo Python <version>` on one line, with the commit and build date when the build recorded them, and exit. See [the version number](versioning.md). |20 | `-version` | bool | `false` | Print `Turbo Python <version>` on one line, with the commit and build date when the build recorded them, and exit. See [the version number](versioning.md). |
21+| `-load-config <url>` | string | none | Copy the `.turbo-python` directory found at a repository URL — rickub, GitHub, GitLab or Codeberg, the URL of the directory as the browser shows it — into the working directory, print what arrived, and exit. Needs `git`. Refuses when `./.turbo-python` already exists. The editor is not started. |
21 | `-h`, `-help` | bool | `false` | Print the flag list and exit. |22 | `-h`, `-help` | bool | `false` | Print the flag list and exit. |
22 23
23 ## Environment24 ## Environment
@@ -34,6 +35,7 @@ Each `file` is opened in its own window. A file that does not exist yet is opene
34 | --- | --- |35 | --- | --- |
35 | `$TURBO_PYTHON_THEME_DIR/*.toml` | User themes, when the variable is set. |36 | `$TURBO_PYTHON_THEME_DIR/*.toml` | User themes, when the variable is set. |
36 | `./.turbo-python/settings.toml` | This project's settings, read once at start-up. See [project settings](project-settings.md). |37 | `./.turbo-python/settings.toml` | This project's settings, read once at start-up. See [project settings](project-settings.md). |
38+| `./.turbo-python/` (written) | Created by `-load-config` from a repository's copy, when the project has none yet. |
37 | `~/.config/turbo-python/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |39 | `~/.config/turbo-python/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |
38 | `~/Library/Application Support/turbo-python/themes/*.toml` | User themes on macOS. |40 | `~/Library/Application Support/turbo-python/themes/*.toml` | User themes on macOS. |
39 | `<module>/pyproject.toml` | Located by walking up from the first file; its directory becomes the language server's root. |41 | `<module>/pyproject.toml` | Located by walking up from the first file; its directory becomes the language server's root. |
@@ -72,6 +74,7 @@ turbo-python main.py pyproject.toml # two windows
72 turbo-python -theme turbo-dark main.py # a different theme74 turbo-python -theme turbo-dark main.py # a different theme
73 turbo-python -no-lsp main.py # no language server75 turbo-python -no-lsp main.py # no language server
74 turbo-python -list-themes # what themes exist76 turbo-python -list-themes # what themes exist
77+turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # start from a shared configuration
75 ```78 ```
76 79
77 ## Installer80 ## Installer
@@ -98,3 +101,7 @@ turbo-python -list-themes # what themes exist
98 | `turbo-python: initialising the terminal: …` | The terminal was opened but could not be put into raw mode. |101 | `turbo-python: initialising the terminal: …` | The terminal was opened but could not be put into raw mode. |
99 | `Cannot open` (in a dialog) | The path is a directory, or is not readable. |102 | `Cannot open` (in a dialog) | The path is a directory, or is not readable. |
100 | `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |103 | `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |
104+| `turbo-python: configrepo: the project already has a configuration directory: …` | `-load-config` into a project that already has `.turbo-python`. Move it away first. |
105+| `turbo-python: configrepo: git is not installed` | `-load-config` needs the `git` command on `PATH`. |
106+| `turbo-python: configrepo: no configuration directory at that path: …` | The repository was found but holds no `.turbo-python` where the URL points. |
107+| `turbo-python: configrepo: no repository answered: …` | No clone address for that URL answered; the URL, the network, or a private repository. |
modified docs/fr/how-to/configure-a-project.md +13 -0
@@ -70,6 +70,19 @@ turbo-python -theme turbo-dark main.py
7070
7171 **Options ▸ Project settings…** le rouvre. L'entrée est grisée dans un projet qui n'en a pas.
7272
73+## Partir d'une configuration partagée
74+
75+Une équipe peut garder des configurations toutes prêtes dans un dépôt — un dossier par sorte de projet, chacun avec un `.turbo-python` dedans. Donnez à l'éditeur l'URL du dossier, telle que le navigateur l'affiche, et il copie ce `.turbo-python` dans le répertoire courant :
76+
77+```bash
78+cd mon-projet
79+turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init
80+```
81+
82+Il affiche ce qui est arrivé et quitte ; le `turbo-python` suivant ouvre le projet avec ces réglages, extraits et outils en vigueur. L'URL peut être sur rickub, GitHub, GitLab ou Codeberg, et pointer sur le dossier, sur le `.turbo-python` qu'il contient, ou sur le dépôt lui-même pour sa racine sur la branche par défaut. `git` doit être installé : la récupération est un clone superficiel.
83+
84+Un projet qui a déjà un `.turbo-python` est laissé tel quel — l'éditeur refuse plutôt que d'écraser ce que le projet a décidé. Déplacez d'abord le dossier si vous voulez le remplacer.
85+
7386 ## Variantes
7487
7588 - **Vous lancez l'éditeur depuis un sous-dossier.** Les réglages ne sont pas trouvés : seul `./.turbo-python` est consulté, sans remontée vers la racine du projet. Lancez depuis le dossier du projet, ou passez `-theme` pour cette fois.
@@ -70,6 +70,19 @@ turbo-python -theme turbo-dark main.py
70 70
71 **Options ▸ Project settings…** le rouvre. L'entrée est grisée dans un projet qui n'en a pas.71 **Options ▸ Project settings…** le rouvre. L'entrée est grisée dans un projet qui n'en a pas.
72 72
73+## Partir d'une configuration partagée
74+
75+Une équipe peut garder des configurations toutes prêtes dans un dépôt — un dossier par sorte de projet, chacun avec un `.turbo-python` dedans. Donnez à l'éditeur l'URL du dossier, telle que le navigateur l'affiche, et il copie ce `.turbo-python` dans le répertoire courant :
76+
77+```bash
78+cd mon-projet
79+turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init
80+```
81+
82+Il affiche ce qui est arrivé et quitte ; le `turbo-python` suivant ouvre le projet avec ces réglages, extraits et outils en vigueur. L'URL peut être sur rickub, GitHub, GitLab ou Codeberg, et pointer sur le dossier, sur le `.turbo-python` qu'il contient, ou sur le dépôt lui-même pour sa racine sur la branche par défaut. `git` doit être installé : la récupération est un clone superficiel.
83+
84+Un projet qui a déjà un `.turbo-python` est laissé tel quel — l'éditeur refuse plutôt que d'écraser ce que le projet a décidé. Déplacez d'abord le dossier si vous voulez le remplacer.
85+
73 ## Variantes86 ## Variantes
74 87
75 - **Vous lancez l'éditeur depuis un sous-dossier.** Les réglages ne sont pas trouvés : seul `./.turbo-python` est consulté, sans remontée vers la racine du projet. Lancez depuis le dossier du projet, ou passez `-theme` pour cette fois.88 - **Vous lancez l'éditeur depuis un sous-dossier.** Les réglages ne sont pas trouvés : seul `./.turbo-python` est consulté, sans remontée vers la racine du projet. Lancez depuis le dossier du projet, ou passez `-theme` pour cette fois.
modified docs/fr/reference/cli.md +7 -0
@@ -18,6 +18,7 @@ Chaque `fichier` est ouvert dans sa propre fenêtre. Un fichier qui n'existe pas
1818 | `-list-themes` | booléen | `false` | Affiche chaque thème chargeable avec sa description, puis le répertoire de thèmes utilisateur, et quitte. |
1919 | `-no-lsp` | booléen | `false` | Ne démarre pas de serveur de langage. La coloration et l'édition sont inchangées. |
2020 | `-version` | booléen | `false` | Affiche `Turbo Python <version>` sur une ligne, avec le commit et la date de build quand le build les a enregistrés, puis quitte. Voir [le numéro de version](versioning.md). |
21+| `-load-config <url>` | chaîne | aucune | Copie le répertoire `.turbo-python` trouvé à l'URL d'un dépôt — rickub, GitHub, GitLab ou Codeberg, l'URL du dossier telle que le navigateur l'affiche — dans le répertoire courant, affiche ce qui est arrivé, et quitte. Nécessite `git`. Refuse si `./.turbo-python` existe déjà. L'éditeur n'est pas lancé. |
2122 | `-h`, `-help` | booléen | `false` | Affiche la liste des options et quitte. |
2223
2324 ## Environnement
@@ -34,6 +35,7 @@ Chaque `fichier` est ouvert dans sa propre fenêtre. Un fichier qui n'existe pas
3435 | --- | --- |
3536 | `$TURBO_PYTHON_THEME_DIR/*.toml` | Thèmes utilisateur, quand la variable est définie. |
3637 | `./.turbo-python/settings.toml` | Les réglages de ce projet, lus une fois au démarrage. Voir [réglages de projet](project-settings.md). |
38+| `./.turbo-python/` (écrit) | Créé par `-load-config` à partir de la copie d'un dépôt, quand le projet n'en a pas encore. |
3739 | `~/.config/turbo-python/themes/*.toml` | Thèmes utilisateur sous Linux (`os.UserConfigDir`). |
3840 | `~/Library/Application Support/turbo-python/themes/*.toml` | Thèmes utilisateur sous macOS. |
3941 | `<module>/pyproject.toml` | Trouvé en remontant depuis le premier fichier ; son répertoire devient la racine du serveur de langage. |
@@ -72,6 +74,7 @@ turbo-python main.py pyproject.toml # deux fenêtres
7274 turbo-python -theme turbo-dark main.py # un autre thème
7375 turbo-python -no-lsp main.py # sans serveur de langage
7476 turbo-python -list-themes # quels thèmes existent
77+turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # partir d'une configuration partagée
7578 ```
7679
7780 ## Installateur
@@ -98,3 +101,7 @@ turbo-python -list-themes # quels thèmes existent
98101 | `turbo-python: initialising the terminal: …` | Le terminal a été ouvert mais n'a pas pu être mis en mode brut. |
99102 | `Cannot open` (dans une boîte) | Le chemin est un répertoire, ou n'est pas lisible. |
100103 | `Cannot save` (dans une boîte) | Le répertoire n'existe pas, ou n'est pas accessible en écriture. |
104+| `turbo-python: configrepo: the project already has a configuration directory: …` | `-load-config` dans un projet qui a déjà `.turbo-python`. Déplacez-le d'abord. |
105+| `turbo-python: configrepo: git is not installed` | `-load-config` a besoin de la commande `git` dans le `PATH`. |
106+| `turbo-python: configrepo: no configuration directory at that path: …` | Le dépôt existe mais ne contient pas de `.turbo-python` là où l'URL pointe. |
107+| `turbo-python: configrepo: no repository answered: …` | Aucune adresse de clone pour cette URL n'a répondu : l'URL, le réseau, ou un dépôt privé. |
@@ -18,6 +18,7 @@ Chaque `fichier` est ouvert dans sa propre fenêtre. Un fichier qui n'existe pas
18 | `-list-themes` | booléen | `false` | Affiche chaque thème chargeable avec sa description, puis le répertoire de thèmes utilisateur, et quitte. |18 | `-list-themes` | booléen | `false` | Affiche chaque thème chargeable avec sa description, puis le répertoire de thèmes utilisateur, et quitte. |
19 | `-no-lsp` | booléen | `false` | Ne démarre pas de serveur de langage. La coloration et l'édition sont inchangées. |19 | `-no-lsp` | booléen | `false` | Ne démarre pas de serveur de langage. La coloration et l'édition sont inchangées. |
20 | `-version` | booléen | `false` | Affiche `Turbo Python <version>` sur une ligne, avec le commit et la date de build quand le build les a enregistrés, puis quitte. Voir [le numéro de version](versioning.md). |20 | `-version` | booléen | `false` | Affiche `Turbo Python <version>` sur une ligne, avec le commit et la date de build quand le build les a enregistrés, puis quitte. Voir [le numéro de version](versioning.md). |
21+| `-load-config <url>` | chaîne | aucune | Copie le répertoire `.turbo-python` trouvé à l'URL d'un dépôt — rickub, GitHub, GitLab ou Codeberg, l'URL du dossier telle que le navigateur l'affiche — dans le répertoire courant, affiche ce qui est arrivé, et quitte. Nécessite `git`. Refuse si `./.turbo-python` existe déjà. L'éditeur n'est pas lancé. |
21 | `-h`, `-help` | booléen | `false` | Affiche la liste des options et quitte. |22 | `-h`, `-help` | booléen | `false` | Affiche la liste des options et quitte. |
22 23
23 ## Environnement24 ## Environnement
@@ -34,6 +35,7 @@ Chaque `fichier` est ouvert dans sa propre fenêtre. Un fichier qui n'existe pas
34 | --- | --- |35 | --- | --- |
35 | `$TURBO_PYTHON_THEME_DIR/*.toml` | Thèmes utilisateur, quand la variable est définie. |36 | `$TURBO_PYTHON_THEME_DIR/*.toml` | Thèmes utilisateur, quand la variable est définie. |
36 | `./.turbo-python/settings.toml` | Les réglages de ce projet, lus une fois au démarrage. Voir [réglages de projet](project-settings.md). |37 | `./.turbo-python/settings.toml` | Les réglages de ce projet, lus une fois au démarrage. Voir [réglages de projet](project-settings.md). |
38+| `./.turbo-python/` (écrit) | Créé par `-load-config` à partir de la copie d'un dépôt, quand le projet n'en a pas encore. |
37 | `~/.config/turbo-python/themes/*.toml` | Thèmes utilisateur sous Linux (`os.UserConfigDir`). |39 | `~/.config/turbo-python/themes/*.toml` | Thèmes utilisateur sous Linux (`os.UserConfigDir`). |
38 | `~/Library/Application Support/turbo-python/themes/*.toml` | Thèmes utilisateur sous macOS. |40 | `~/Library/Application Support/turbo-python/themes/*.toml` | Thèmes utilisateur sous macOS. |
39 | `<module>/pyproject.toml` | Trouvé en remontant depuis le premier fichier ; son répertoire devient la racine du serveur de langage. |41 | `<module>/pyproject.toml` | Trouvé en remontant depuis le premier fichier ; son répertoire devient la racine du serveur de langage. |
@@ -72,6 +74,7 @@ turbo-python main.py pyproject.toml # deux fenêtres
72 turbo-python -theme turbo-dark main.py # un autre thème74 turbo-python -theme turbo-dark main.py # un autre thème
73 turbo-python -no-lsp main.py # sans serveur de langage75 turbo-python -no-lsp main.py # sans serveur de langage
74 turbo-python -list-themes # quels thèmes existent76 turbo-python -list-themes # quels thèmes existent
77+turbo-python -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # partir d'une configuration partagée
75 ```78 ```
76 79
77 ## Installateur80 ## Installateur
@@ -98,3 +101,7 @@ turbo-python -list-themes # quels thèmes existent
98 | `turbo-python: initialising the terminal: …` | Le terminal a été ouvert mais n'a pas pu être mis en mode brut. |101 | `turbo-python: initialising the terminal: …` | Le terminal a été ouvert mais n'a pas pu être mis en mode brut. |
99 | `Cannot open` (dans une boîte) | Le chemin est un répertoire, ou n'est pas lisible. |102 | `Cannot open` (dans une boîte) | Le chemin est un répertoire, ou n'est pas lisible. |
100 | `Cannot save` (dans une boîte) | Le répertoire n'existe pas, ou n'est pas accessible en écriture. |103 | `Cannot save` (dans une boîte) | Le répertoire n'existe pas, ou n'est pas accessible en écriture. |
104+| `turbo-python: configrepo: the project already has a configuration directory: …` | `-load-config` dans un projet qui a déjà `.turbo-python`. Déplacez-le d'abord. |
105+| `turbo-python: configrepo: git is not installed` | `-load-config` a besoin de la commande `git` dans le `PATH`. |
106+| `turbo-python: configrepo: no configuration directory at that path: …` | Le dépôt existe mais ne contient pas de `.turbo-python` là où l'URL pointe. |
107+| `turbo-python: configrepo: no repository answered: …` | Aucune adresse de clone pour cette URL n'a répondu : l'URL, le réseau, ou un dépôt privé. |
modified go.mod +1 -1
@@ -4,7 +4,7 @@ go 1.26.1
44
55 require (
66 github.com/gdamore/tcell/v2 v2.13.10
7- rickub.com/turbo-editors/turbo-core v1.0.2
7+ rickub.com/turbo-editors/turbo-core v1.0.3
88 )
99
1010 require (
@@ -4,7 +4,7 @@ go 1.26.1
4 4
5 require (5 require (
6 github.com/gdamore/tcell/v2 v2.13.106 github.com/gdamore/tcell/v2 v2.13.10
7- rickub.com/turbo-editors/turbo-core v1.0.27+ rickub.com/turbo-editors/turbo-core v1.0.3
8 )8 )
9 9
10 require (10 require (
modified go.sum +2 -2
@@ -45,5 +45,5 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
4545 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
4646 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
4747 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
48-rickub.com/turbo-editors/turbo-core v1.0.2 h1:OA/LhR6JkvtUlp6lTgYa0wwaWou3HKXd1Glnoscyffw=
49-rickub.com/turbo-editors/turbo-core v1.0.2/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
48+rickub.com/turbo-editors/turbo-core v1.0.3 h1:j+bqzIIBsese8iLgre9PQdbpi9YkoOMIHP6pOli5UjE=
49+rickub.com/turbo-editors/turbo-core v1.0.3/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
@@ -45,5 +45,5 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
45 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=45 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
46 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=46 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
47 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=47 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
48-rickub.com/turbo-editors/turbo-core v1.0.2 h1:OA/LhR6JkvtUlp6lTgYa0wwaWou3HKXd1Glnoscyffw=48+rickub.com/turbo-editors/turbo-core v1.0.3 h1:j+bqzIIBsese8iLgre9PQdbpi9YkoOMIHP6pOli5UjE=
49-rickub.com/turbo-editors/turbo-core v1.0.2/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=49+rickub.com/turbo-editors/turbo-core v1.0.3/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
modified main.go +38 -0
@@ -16,6 +16,7 @@
1616 // -list-themes print the available themes and exit
1717 // -no-lsp do not start a language server
1818 // -version print the version and exit
19+// -load-config url copy the .turbo-python directory found at a repository URL into the working directory and exit
1920 package main
2021
2122 import (
@@ -24,10 +25,12 @@ import (
2425 "flag"
2526 "fmt"
2627 "os"
28+ "strings"
2729
2830 "github.com/gdamore/tcell/v2"
2931
3032 "rickub.com/turbo-editors/turbo-core/app"
33+ "rickub.com/turbo-editors/turbo-core/configrepo"
3134 "rickub.com/turbo-editors/turbo-core/profile"
3235 "rickub.com/turbo-editors/turbo-core/settings"
3336 "rickub.com/turbo-editors/turbo-core/theme"
@@ -47,6 +50,7 @@ func main() {
4750 type options struct {
4851 theme string
4952 listThemes bool
53+ loadConfig string
5054 noLSP bool
5155 version bool
5256 files []string
@@ -63,6 +67,7 @@ func parseFlags() options {
6367 flag.BoolVar(&opts.listThemes, "list-themes", false, "print the available themes and exit")
6468 flag.BoolVar(&opts.noLSP, "no-lsp", false, "do not start a language server")
6569 flag.BoolVar(&opts.version, "version", false, "print the version and exit")
70+ flag.StringVar(&opts.loadConfig, "load-config", "", "copy the .turbo-python directory found at this repository URL into the working directory, then exit")
6671 flag.Parse()
6772
6873 opts.files = flag.Args()
@@ -83,6 +88,8 @@ func run() error {
8388 return nil
8489 case opts.listThemes:
8590 return listThemes(p)
91+ case opts.loadConfig != "":
92+ return loadConfig(p, opts.loadConfig)
8693 }
8794
8895 return edit(opts, p)
@@ -107,6 +114,37 @@ func listThemes(p profile.Profile) error {
107114 return nil
108115 }
109116
117+// loadConfig copies a shared configuration — the .turbo-python directory at a
118+// repository URL, on rickub, GitHub, GitLab or Codeberg — into the working
119+// directory, and says what arrived. The editor is not started: this is a
120+// set-up step, and the next command is the one that opens the project.
121+//
122+// A project that already has a .turbo-python is left alone; turbo-core refuses
123+// rather than overwrite what the project decided.
124+func loadConfig(p profile.Profile, url string) error {
125+ result, err := configrepo.Load(context.Background(), p, url, ".")
126+ if err != nil {
127+ return err
128+ }
129+ fmt.Print(describeLoad(result))
130+ return nil
131+}
132+
133+// describeLoad is what a successful -load-config prints: where the files
134+// came from, and each of them, so the reader knows what is now in force.
135+func describeLoad(result configrepo.Result) string {
136+ var out strings.Builder
137+ fmt.Fprintf(&out, "Copied %s from %s", result.Dir, result.Remote)
138+ if result.Ref != "" {
139+ fmt.Fprintf(&out, " (%s)", result.Ref)
140+ }
141+ out.WriteString(":\n")
142+ for _, file := range result.Files {
143+ fmt.Fprintf(&out, " %s\n", file)
144+ }
145+ return out.String()
146+}
147+
110148 // edit opens the terminal and runs the editor until the user leaves.
111149 func edit(opts options, p profile.Profile) error {
112150 project, projectSettings := loadProjectSettings(p)
@@ -16,6 +16,7 @@
16 // -list-themes print the available themes and exit16 // -list-themes print the available themes and exit
17 // -no-lsp do not start a language server17 // -no-lsp do not start a language server
18 // -version print the version and exit18 // -version print the version and exit
19+// -load-config url copy the .turbo-python directory found at a repository URL into the working directory and exit
19 package main20 package main
20 21
21 import (22 import (
@@ -24,10 +25,12 @@ import (
24 "flag"25 "flag"
25 "fmt"26 "fmt"
26 "os"27 "os"
28+ "strings"
27 29
28 "github.com/gdamore/tcell/v2"30 "github.com/gdamore/tcell/v2"
29 31
30 "rickub.com/turbo-editors/turbo-core/app"32 "rickub.com/turbo-editors/turbo-core/app"
33+ "rickub.com/turbo-editors/turbo-core/configrepo"
31 "rickub.com/turbo-editors/turbo-core/profile"34 "rickub.com/turbo-editors/turbo-core/profile"
32 "rickub.com/turbo-editors/turbo-core/settings"35 "rickub.com/turbo-editors/turbo-core/settings"
33 "rickub.com/turbo-editors/turbo-core/theme"36 "rickub.com/turbo-editors/turbo-core/theme"
@@ -47,6 +50,7 @@ func main() {
47 type options struct {50 type options struct {
48 theme string51 theme string
49 listThemes bool52 listThemes bool
53+ loadConfig string
50 noLSP bool54 noLSP bool
51 version bool55 version bool
52 files []string56 files []string
@@ -63,6 +67,7 @@ func parseFlags() options {
63 flag.BoolVar(&opts.listThemes, "list-themes", false, "print the available themes and exit")67 flag.BoolVar(&opts.listThemes, "list-themes", false, "print the available themes and exit")
64 flag.BoolVar(&opts.noLSP, "no-lsp", false, "do not start a language server")68 flag.BoolVar(&opts.noLSP, "no-lsp", false, "do not start a language server")
65 flag.BoolVar(&opts.version, "version", false, "print the version and exit")69 flag.BoolVar(&opts.version, "version", false, "print the version and exit")
70+ flag.StringVar(&opts.loadConfig, "load-config", "", "copy the .turbo-python directory found at this repository URL into the working directory, then exit")
66 flag.Parse()71 flag.Parse()
67 72
68 opts.files = flag.Args()73 opts.files = flag.Args()
@@ -83,6 +88,8 @@ func run() error {
83 return nil88 return nil
84 case opts.listThemes:89 case opts.listThemes:
85 return listThemes(p)90 return listThemes(p)
91+ case opts.loadConfig != "":
92+ return loadConfig(p, opts.loadConfig)
86 }93 }
87 94
88 return edit(opts, p)95 return edit(opts, p)
@@ -107,6 +114,37 @@ func listThemes(p profile.Profile) error {
107 return nil114 return nil
108 }115 }
109 116
117+// loadConfig copies a shared configuration — the .turbo-python directory at a
118+// repository URL, on rickub, GitHub, GitLab or Codeberg — into the working
119+// directory, and says what arrived. The editor is not started: this is a
120+// set-up step, and the next command is the one that opens the project.
121+//
122+// A project that already has a .turbo-python is left alone; turbo-core refuses
123+// rather than overwrite what the project decided.
124+func loadConfig(p profile.Profile, url string) error {
125+ result, err := configrepo.Load(context.Background(), p, url, ".")
126+ if err != nil {
127+ return err
128+ }
129+ fmt.Print(describeLoad(result))
130+ return nil
131+}
132+
133+// describeLoad is what a successful -load-config prints: where the files
134+// came from, and each of them, so the reader knows what is now in force.
135+func describeLoad(result configrepo.Result) string {
136+ var out strings.Builder
137+ fmt.Fprintf(&out, "Copied %s from %s", result.Dir, result.Remote)
138+ if result.Ref != "" {
139+ fmt.Fprintf(&out, " (%s)", result.Ref)
140+ }
141+ out.WriteString(":\n")
142+ for _, file := range result.Files {
143+ fmt.Fprintf(&out, " %s\n", file)
144+ }
145+ return out.String()
146+}
147+
110 // edit opens the terminal and runs the editor until the user leaves.148 // edit opens the terminal and runs the editor until the user leaves.
111 func edit(opts options, p profile.Profile) error {149 func edit(opts options, p profile.Profile) error {
112 project, projectSettings := loadProjectSettings(p)150 project, projectSettings := loadProjectSettings(p)
modified main_test.go +41 -0
@@ -1,11 +1,14 @@
11 package main
22
33 import (
4+ "errors"
45 "os"
56 "path/filepath"
7+ "strings"
68 "testing"
79
810 "rickub.com/turbo-editors/turbo-core/app"
11+ "rickub.com/turbo-editors/turbo-core/configrepo"
912 "rickub.com/turbo-editors/turbo-core/settings"
1013 "rickub.com/turbo-editors/turbo-core/theme"
1114
@@ -154,3 +157,41 @@ func TestABrokenSettingsFileDoesNotStopTheEditor(t *testing.T) {
154157 t.Errorf("loadProjectSettings(pythonlang.Profile()) = %+v, want the defaults", loaded)
155158 }
156159 }
160+
161+func TestDescribeLoadNamesTheSourceAndEveryFile(t *testing.T) {
162+ got := describeLoad(configrepo.Result{
163+ Remote: "https://git.rickub.com/turbo-editors/configs.git",
164+ Ref: "main",
165+ Dir: "/work/.turbo-python",
166+ Files: []string{"settings.toml", "tools.toml"},
167+ })
168+
169+ want := "Copied /work/.turbo-python from https://git.rickub.com/turbo-editors/configs.git (main):\n settings.toml\n tools.toml\n"
170+ if got != want {
171+ t.Errorf("describeLoad() =\n%q\nwant\n%q", got, want)
172+ }
173+}
174+
175+func TestDescribeLoadOmitsTheRefWhenTheDefaultBranchWasUsed(t *testing.T) {
176+ got := describeLoad(configrepo.Result{Remote: "r", Dir: "d"})
177+
178+ if strings.Contains(got, "(") {
179+ t.Errorf("describeLoad() = %q, want no parenthesised ref", got)
180+ }
181+}
182+
183+func TestLoadConfigLeavesAProjectThatHasAConfigurationAlone(t *testing.T) {
184+ // Checked before anything is fetched, so this needs neither git nor a
185+ // network: the project's own .turbo-python is a decision, not a default.
186+ project := t.TempDir()
187+ if err := os.MkdirAll(filepath.Join(project, ".turbo-python"), 0o755); err != nil {
188+ t.Fatal(err)
189+ }
190+ t.Chdir(project)
191+
192+ err := loadConfig(pythonlang.Profile(), "https://rickub.com/turbo-editors/configs/tree/main/golang-init")
193+
194+ if !errors.Is(err, configrepo.ErrExists) {
195+ t.Errorf("loadConfig() error = %v, want ErrExists", err)
196+ }
197+}
@@ -1,11 +1,14 @@
1 package main1 package main
2 2
3 import (3 import (
4+ "errors"
4 "os"5 "os"
5 "path/filepath"6 "path/filepath"
7+ "strings"
6 "testing"8 "testing"
7 9
8 "rickub.com/turbo-editors/turbo-core/app"10 "rickub.com/turbo-editors/turbo-core/app"
11+ "rickub.com/turbo-editors/turbo-core/configrepo"
9 "rickub.com/turbo-editors/turbo-core/settings"12 "rickub.com/turbo-editors/turbo-core/settings"
10 "rickub.com/turbo-editors/turbo-core/theme"13 "rickub.com/turbo-editors/turbo-core/theme"
11 14
@@ -154,3 +157,41 @@ func TestABrokenSettingsFileDoesNotStopTheEditor(t *testing.T) {
154 t.Errorf("loadProjectSettings(pythonlang.Profile()) = %+v, want the defaults", loaded)157 t.Errorf("loadProjectSettings(pythonlang.Profile()) = %+v, want the defaults", loaded)
155 }158 }
156 }159 }
160+
161+func TestDescribeLoadNamesTheSourceAndEveryFile(t *testing.T) {
162+ got := describeLoad(configrepo.Result{
163+ Remote: "https://git.rickub.com/turbo-editors/configs.git",
164+ Ref: "main",
165+ Dir: "/work/.turbo-python",
166+ Files: []string{"settings.toml", "tools.toml"},
167+ })
168+
169+ want := "Copied /work/.turbo-python from https://git.rickub.com/turbo-editors/configs.git (main):\n settings.toml\n tools.toml\n"
170+ if got != want {
171+ t.Errorf("describeLoad() =\n%q\nwant\n%q", got, want)
172+ }
173+}
174+
175+func TestDescribeLoadOmitsTheRefWhenTheDefaultBranchWasUsed(t *testing.T) {
176+ got := describeLoad(configrepo.Result{Remote: "r", Dir: "d"})
177+
178+ if strings.Contains(got, "(") {
179+ t.Errorf("describeLoad() = %q, want no parenthesised ref", got)
180+ }
181+}
182+
183+func TestLoadConfigLeavesAProjectThatHasAConfigurationAlone(t *testing.T) {
184+ // Checked before anything is fetched, so this needs neither git nor a
185+ // network: the project's own .turbo-python is a decision, not a default.
186+ project := t.TempDir()
187+ if err := os.MkdirAll(filepath.Join(project, ".turbo-python"), 0o755); err != nil {
188+ t.Fatal(err)
189+ }
190+ t.Chdir(project)
191+
192+ err := loadConfig(pythonlang.Profile(), "https://rickub.com/turbo-editors/configs/tree/main/golang-init")
193+
194+ if !errors.Is(err, configrepo.ErrExists) {
195+ t.Errorf("loadConfig() error = %v, want ErrExists", err)
196+ }
197+}