Skip to content

Commit 311e4ef

Browse files
committed
feat: translate README and sync_issue.py to English; update transform.py documentation
1 parent c34bf1a commit 311e4ef

3 files changed

Lines changed: 159 additions & 163 deletions

File tree

README.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
# generate_startercode
22

3-
Automatische Erzeugung von Startercode- und Solution-Branches aus einem gemeinsamen main-Branch.
3+
Automatic generation of startercode and solution branches from a shared main branch.
44

5-
Das Repository ist jetzt als uv-Projekt aufgebaut, enthält Tests und nutzt GitHub Actions fuer pre-commit, Tests und automatische Releases mit Semantic Release.
5+
This repository is now structured as a uv project, includes tests, and uses GitHub Actions for pre-commit, tests, and automatic releases with Semantic Release.
66

77
## Installation (uv)
88

9-
1. uv installieren: https://docs.astral.sh/uv/
10-
2. Abhaengigkeiten installieren:
9+
1. Install uv: https://docs.astral.sh/uv/
10+
2. Install dependencies:
1111

1212
```bash
1313
uv sync --extra dev
1414
```
1515

16-
3. Optional pre-commit Hooks installieren:
16+
3. Optionally install pre-commit hooks:
1717

1818
```bash
1919
uv run pre-commit install --install-hooks
2020
```
2121

22-
## Lokale Nutzung
22+
## Local Usage
2323

2424
### transform.py
2525

2626
```bash
27-
uv run python transform.py --target solution --repo-root /pfad/zum/repo
28-
uv run python transform.py --target startercode --repo-root /pfad/zum/repo
27+
uv run python transform.py --target solution --repo-root /path/to/repo
28+
uv run python transform.py --target startercode --repo-root /path/to/repo
2929
```
3030

3131
### sync_issue.py
@@ -34,11 +34,11 @@ uv run python transform.py --target startercode --repo-root /pfad/zum/repo
3434
uv run python sync_issue.py
3535
```
3636

37-
Hinweis: Fuer sync_issue.py werden die GitLab-Umgebungsvariablen erwartet, insbesondere GITLAB_TOKEN, CI_SERVER_URL und CI_PROJECT_PATH.
37+
Note: sync_issue.py expects GitLab environment variables, especially GITLAB_TOKEN, CI_SERVER_URL, and CI_PROJECT_PATH.
3838

39-
## Neueste Release-Version herunterladen
39+
## Download Latest Release Version
4040

41-
Die Skripte koennen aus dem neuesten GitHub Release-Tag geladen werden (statt von main):
41+
You can download the scripts from the latest GitHub release tag (instead of main):
4242

4343
```bash
4444
LATEST_TAG=$(curl -fsSL https://api.github.com/repos/obcode/generate_startercode/releases/latest | python3 -c "import json,sys; print(json.load(sys.stdin)['tag_name'])")
@@ -48,14 +48,14 @@ curl -fsSL "https://raw.githubusercontent.com/obcode/generate_startercode/${LATE
4848
curl -fsSL "https://raw.githubusercontent.com/obcode/generate_startercode/${LATEST_TAG}/sync_issue.py" -o /tmp/sync_issue.py
4949
```
5050

51-
## Ersatz fuer bestehende GitLab CI Nutzung
51+
## Replacement for Existing GitLab CI Usage
5252

53-
Wenn du bisher in deinem GitLab-Projekt direkt von main geladen hast, ersetze das durch einen Download aus dem neuesten GitHub Release-Tag.
53+
If your GitLab project currently downloads directly from main, replace that with a download from the latest GitHub release tag.
5454

55-
Die folgende .gitlab-ci Konfiguration ist der direkte Ersatz fuer deinen bisherigen Flow:
55+
The following .gitlab-ci configuration is a direct replacement for your previous flow:
5656

5757
```yaml
58-
# ── Issue syncen ──────────────────────────────────────────────
58+
# -- Sync issue ------------------------------------------------
5959
sync-issue:
6060
stage: sync
6161
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/library/python:3.12-bookworm
@@ -74,7 +74,7 @@ sync-issue:
7474
- .gitlab/ci/teacher.yml
7575
- .gitlab-ci.yml
7676

77-
# ── Branches generieren ───────────────────────────────────────
77+
# -- Generate branches -----------------------------------------
7878
publish-branches:
7979
stage: publish
8080
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/library/python:3.12-bookworm
@@ -104,13 +104,13 @@ publish-branches:
104104
- .gitlab-ci.yml
105105
```
106106
107-
Hinweis: Dafuer muss mindestens ein GitHub Release vorhanden sein. Die zusaetzliche Umgebungsvariable GENERATE_STARTERCODE_VERSION sorgt dafuer, dass das heruntergeladene Einzel-Skript auch ohne lokales pyproject die richtige Release-Version anzeigt. Falls noch kein Release existiert, initial einmalig gegen einen festen Tag laden (zum Beispiel v1.0.0) oder kurzzeitig gegen main.
107+
Note: At least one GitHub release must exist. The additional environment variable GENERATE_STARTERCODE_VERSION ensures that the downloaded standalone script reports the correct release version even without a local pyproject. If no release exists yet, initially load once from a fixed tag (for example v1.0.0) or temporarily from main.
108108
109-
## Konfiguration: .gitlab/ci/config.yml
109+
## Configuration: .gitlab/ci/config.yml
110110
111-
Die Datei `.gitlab/ci/config.yml` steuert, was pro Target (solution/startercode) in den generierten Branch uebernommen wird. Code-Transformationen (SOLUTION_BEGIN/END-Marker) sind direkt im Quellcode definiert – hier werden nur Pfad-Entfernungen, Datei-Patches und Post-Process-Kommandos konfiguriert.
111+
The file `.gitlab/ci/config.yml` controls what is included per target (solution/startercode) in generated branches. Code transformations (SOLUTION_BEGIN/END markers) are defined directly in source code. This config only controls path removals, file patches, and postprocess commands.
112112

113-
### Vollstaendiges Beispiel
113+
### Complete Example
114114

115115
```yaml
116116
# .gitlab/ci/config.yml
@@ -144,26 +144,26 @@ startercode:
144144

145145
### remove_paths
146146

147-
Liste von Pfaden (Dateien oder Verzeichnisse), die im generierten Branch komplett entfernt werden. Pfade sind relativ zum Repository-Root.
147+
List of paths (files or directories) that are fully removed in the generated branch. Paths are relative to the repository root.
148148

149149
```yaml
150150
solution:
151151
remove_paths:
152-
- Aufgabenstellung # ganzes Verzeichnis
153-
- .gitlab/ci # Unterverzeichnis
154-
- src/secret_tests.py # einzelne Datei
152+
- Aufgabenstellung # full directory
153+
- .gitlab/ci # subdirectory
154+
- src/secret_tests.py # single file
155155
```
156156

157157
### patch_files
158158

159-
Ermoeglicht es, einzelne Dateien im generierten Branch zeilenweise zu veraendern. Aktuell unterstuetzte Operation: `remove_line_containing` – entfernt alle Zeilen, die den angegebenen Teilstring enthalten.
159+
Allows line-based modifications for selected files in the generated branch. Currently supported operation: `remove_line_containing` - removes all lines containing the given substring.
160160

161161
```yaml
162162
solution:
163163
patch_files:
164164
.gitlab-ci.yml:
165165
remove_line_containing:
166-
- ".gitlab/ci/teacher.yml" # entfernt jede Zeile, die diesen String enthaelt
166+
- ".gitlab/ci/teacher.yml" # removes every line containing this string
167167
- "include:"
168168
README.md:
169169
remove_line_containing:
@@ -172,7 +172,7 @@ solution:
172172

173173
### postprocess_commands
174174

175-
Shell-Kommandos, die nach allen anderen Transformationen im generierten Tree ausgefuehrt werden, bevor der Branch committed wird. Nuetzlich, um Formatter oder Linter nach der Marker-Entfernung auszufuehren.
175+
Shell commands executed in the generated tree after all other transformations and before committing the branch. Useful for running formatters or linters after marker removal.
176176

177177
**Python/Ruff:**
178178

@@ -192,46 +192,46 @@ solution:
192192
- gofmt -w .
193193
```
194194

195-
Hinweis: `goimports` benoetigt `go install golang.org/x/tools/cmd/goimports@latest` in der CI-Umgebung. Falls nur Formatierung benoetigt wird, reicht `gofmt`.
195+
Note: `goimports` requires `go install golang.org/x/tools/cmd/goimports@latest` in the CI environment. If you only need formatting, `gofmt` is enough.
196196

197197
## GitHub Actions
198198

199199
### CI Workflow
200200

201-
Datei: .github/workflows/ci.yml
201+
File: .github/workflows/ci.yml
202202

203-
Fuehrt bei Push auf main und bei Pull Requests aus:
203+
Runs on push to main and on pull requests:
204204

205-
- pre-commit auf allen Dateien
206-
- pytest Testsuite
207-
- Semantic Release Dry-Run bei Pull Requests (`--print`)
208-
- Semantic Release auf main, aber nur wenn pre-commit und Tests erfolgreich sind
205+
- pre-commit on all files
206+
- pytest test suite
207+
- Semantic Release dry-run on pull requests (`--print`)
208+
- Semantic Release on main, but only if pre-commit and tests succeed
209209

210210
### Release Workflow
211211

212-
Datei: .github/workflows/release.yml
212+
File: .github/workflows/release.yml
213213

214-
Optionaler manueller Workflow (`workflow_dispatch`) fuer Release-Experimente.
214+
Optional manual workflow (`workflow_dispatch`) for release experiments.
215215

216-
## Versionierung ohne harte Einzelwerte
216+
## Versioning Without Hardcoded Single Values
217217

218-
Die Skripte lesen ihre Version nicht mehr aus einem manuell gepflegten, festen Wert.
219-
Stattdessen wird die Version aus den Paket-Metadaten bzw. aus pyproject.toml aufgeloest.
220-
Die Version in pyproject.toml wird durch Semantic Release gepflegt.
218+
Scripts no longer read their version from a manually maintained fixed value.
219+
Instead, the version is resolved from package metadata or pyproject.toml.
220+
The version in pyproject.toml is managed by Semantic Release.
221221

222222
## Tests
223223

224-
Die Tests liegen unter tests/ und koennen lokal mit uv ausgefuehrt werden:
224+
Tests are located under tests/ and can be run locally with uv:
225225

226226
```bash
227227
uv run pytest
228228
```
229229

230230
## Pre-commit
231231

232-
Die bestehende Datei .pre-commit-config.yaml bleibt aktiv und wird in CI ausgefuehrt.
232+
The existing .pre-commit-config.yaml remains active and is executed in CI.
233233

234-
Manuell ausfuehren:
234+
Run manually:
235235

236236
```bash
237237
uv run pre-commit run --all-files

0 commit comments

Comments
 (0)