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?
This exercise is part of the course
AI-Assisted Coding for Developers
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
 Start Exercise
Start Exercise