Misc Changes

This commit is contained in:
Joe Tretter
2026-05-06 21:28:44 -05:00
parent 5727022baf
commit e1b2d7f7a1
64 changed files with 1662 additions and 300 deletions

View File

@@ -0,0 +1,22 @@
package solutions.tretter.githugandroid
/**
* Port of the upstream ruby-githug `config` level.
*
* Setup documents the repository shape the learner explores. Evaluation is kept
* state-based whenever the exercise changes repository objects; answer-only
* levels intentionally validate the answer entered at the prompt.
*/
internal fun configLevel(): Level = level(
id = "config",
title = "Config",
description = "Set up your git name and email; this is important so that your commits can be identified.",
hints = listOf("Use `git config user.name ...` and `git config user.email ...`."),
commandSuggestions = listOf("git config user.name GitHug", "git config user.email githug@example.com"),
setup = { RepoState(initialized = true, branches = mapOf("master" to 0)) },
validator = repoPredicate { repo -> repo.config["user.name"].orEmpty().isNotBlank() && repo.config["user.email"].orEmpty().isNotBlank() },
testCases = listOf(
levelTestCase("name then email", "git config user.name GitHug", "git config user.email githug@example.com"),
levelTestCase("email then name", "git config user.email githug@example.com", "git config user.name GitHug"),
),
)