Filter more messages, disallow new lines
This commit is contained in:
parent
20a77a5838
commit
a88fbe379c
8
main.py
8
main.py
|
@ -46,7 +46,7 @@ Write a ONE LINE git commit message for the following diff.
|
||||||
Respond with only the commit message.
|
Respond with only the commit message.
|
||||||
Do not include quotes.
|
Do not include quotes.
|
||||||
Do not include file extensions.
|
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.
|
Tersely summarize how each note changed.
|
||||||
Write in imperitive tense.
|
Write in imperitive tense.
|
||||||
\n\n==============\n\n'''
|
\n\n==============\n\n'''
|
||||||
|
@ -67,6 +67,9 @@ Write in imperitive tense.
|
||||||
elif 'notes/' in message.lower():
|
elif 'notes/' in message.lower():
|
||||||
logging.info(' Message contains notes directory, aborting')
|
logging.info(' Message contains notes directory, aborting')
|
||||||
return False
|
return False
|
||||||
|
elif '\n' in message:
|
||||||
|
logging.info(' Message contains new lines, aborting')
|
||||||
|
return False
|
||||||
|
|
||||||
return message
|
return message
|
||||||
|
|
||||||
|
@ -89,6 +92,9 @@ def main():
|
||||||
logging.info('Unable to generate acceptable message, exiting.')
|
logging.info('Unable to generate acceptable message, exiting.')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
if DEBUG:
|
||||||
|
logging.info('Running in debug, not actually committing.')
|
||||||
|
else:
|
||||||
git_commit(message)
|
git_commit(message)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user