You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-43Lines changed: 43 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,31 @@
1
1
# generate_startercode
2
2
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.
4
4
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.
6
6
7
7
## Installation (uv)
8
8
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:
11
11
12
12
```bash
13
13
uv sync --extra dev
14
14
```
15
15
16
-
3.Optional pre-commit Hooks installieren:
16
+
3.Optionally install pre-commit hooks:
17
17
18
18
```bash
19
19
uv run pre-commit install --install-hooks
20
20
```
21
21
22
-
## Lokale Nutzung
22
+
## Local Usage
23
23
24
24
### transform.py
25
25
26
26
```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
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.
108
108
109
-
## Konfiguration: .gitlab/ci/config.yml
109
+
## Configuration: .gitlab/ci/config.yml
110
110
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.
112
112
113
-
### Vollstaendiges Beispiel
113
+
### Complete Example
114
114
115
115
```yaml
116
116
# .gitlab/ci/config.yml
@@ -144,26 +144,26 @@ startercode:
144
144
145
145
### remove_paths
146
146
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.
148
148
149
149
```yaml
150
150
solution:
151
151
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
155
155
```
156
156
157
157
### patch_files
158
158
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.
160
160
161
161
```yaml
162
162
solution:
163
163
patch_files:
164
164
.gitlab-ci.yml:
165
165
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
167
167
- "include:"
168
168
README.md:
169
169
remove_line_containing:
@@ -172,7 +172,7 @@ solution:
172
172
173
173
### postprocess_commands
174
174
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.
176
176
177
177
**Python/Ruff:**
178
178
@@ -192,46 +192,46 @@ solution:
192
192
- gofmt -w .
193
193
```
194
194
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.
196
196
197
197
## GitHub Actions
198
198
199
199
### CI Workflow
200
200
201
-
Datei: .github/workflows/ci.yml
201
+
File: .github/workflows/ci.yml
202
202
203
-
Fuehrt bei Push auf main und bei Pull Requests aus:
203
+
Runs on push to main and on pull requests:
204
204
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
0 commit comments