ComeçarComece de graça

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 exercício faz parte do curso

AI-Assisted Coding for Developers

Ver curso

Exercício interativo prático

Transforme a teoria em ação com um de nossos exercícios interativos

Começar o exercício