benthayer / benthayer/git-gud

`make_level.py` custom levels

Open
#272 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
558
Forks
53
PR merge metrics
No merged PRs in 30d

Description

A custom level looks something like this. It's not much different than a normal level, but they are used frequently for custom status messages and other things.

Having these automatically generated (as stubs) would help avoid confusion.
```
class Init(BasicLevel):
def _setup(self):
# Make sure we are not in a git repo
file_operator = operations.get_operator()
file_operator.destroy_repo()

def post_setup(self):
self.cat_file("post-setup.txt")

def status(self):
simulate_command("git status")

def _test(self):
# Check if we are in a git repo
file_operator = operations.get_operator()
return file_operator.repo_exists()

def test_failed(self):
default_fail_no_reset()

def test_passed(self):
self.cat_file("passed.txt")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.