LoslegenKostenlos loslegen

Effective commit messages with AI

You’re now committing your AI-generated docstrings, plus small fixes. Since you are quite happy with the model's performance in docstring generation, you decide to also use it to generate meaningful commit messages the code changes displayed as git diff. So far, you wrote the following prompt:

Based on the following code diff, write a commit message:

🟥 -def is_valid_account_number(account: str) -> bool:
🟥 -  return account.isdigit()
🟩 +def is_valid_account_number(account: str) -> bool:
🟩 +  if not account.isdigit():
🟩 +    return False
🟩 +  if len(account) != 10:
🟩 +    return False
🟩 +  return True

What is this prompt missing to guide the model more effectively?

Diese Übung ist Teil des Kurses

AI-Assisted Coding for Developers

Kurs anzeigen

Interaktive Übung

In dieser interaktiven Übung kannst du die Theorie in die Praxis umsetzen.

Übung starten