Commit 3e4a539b authored by Kevin Lyda's avatar Kevin Lyda 💬 Committed by GitHub

Merge pull request #10 from gurgeous/master

Make sure each file has a trailing newline.
parents 35282020 a5607365
Pipeline #1039 passed with stage
in 3 minutes and 41 seconds
......@@ -1083,6 +1083,8 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
cron_line_factory = CronLineFactory()
with open(crontab_file, 'r') as crontab_f:
for line in crontab_f:
missing_newline = line[-1] != "\n"
line = line.strip()
line_no += 1
......@@ -1091,5 +1093,9 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
log.Emit(line_no, line)
# are we missing a trailing newline?
if missing_newline:
log.Error('Cron will not process this file - missing trailing newline')
# Summarize the log messages if there were any.
return log.Summary()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment