ComenzarEmpieza gratis

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?

Este ejercicio forma parte del curso

AI-Assisted Coding for Developers

Ver curso

Ejercicio interactivo práctico

Pon en práctica la teoría con uno de nuestros ejercicios interactivos

Empezar ejercicio