Filter more messages, disallow new lines

This commit is contained in:
Tanner Collin 2024-09-26 18:41:29 +00:00
parent 20a77a5838
commit a88fbe379c

10
main.py
View File

@ -46,7 +46,7 @@ Write a ONE LINE git commit message for the following diff.
Respond with only the commit message.
Do not include quotes.
Do not include file extensions.
DO NOT just say "Update notes", "Add new notes", "Refactor notes".
DO NOT just say "Update notes", "Add new notes", "Refactor notes", "Make documentation updates".
Tersely summarize how each note changed.
Write in imperitive tense.
\n\n==============\n\n'''
@ -67,6 +67,9 @@ Write in imperitive tense.
elif 'notes/' in message.lower():
logging.info(' Message contains notes directory, aborting')
return False
elif '\n' in message:
logging.info(' Message contains new lines, aborting')
return False
return message
@ -89,7 +92,10 @@ def main():
logging.info('Unable to generate acceptable message, exiting.')
exit(1)
git_commit(message)
if DEBUG:
logging.info('Running in debug, not actually committing.')
else:
git_commit(message)
if __name__ == '__main__':