CommencerCommencer gratuitement

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?

Cet exercice fait partie du cours

AI-Assisted Coding for Developers

Afficher le cours

Exercice interactif pratique

Passez de la théorie à la pratique avec l’un de nos exercices interactifs

Commencer l’exercice