Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chkcrontab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
chkcrontab
Commits
a5607365
Commit
a5607365
authored
9 years ago
by
amd
Browse files
Options
Downloads
Patches
Plain Diff
Make sure each file has a trailing newline.
parent
d4cbe2ca
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
chkcrontab_lib.py
+6
-0
6 additions, 0 deletions
chkcrontab_lib.py
with
6 additions
and
0 deletions
chkcrontab_lib.py
+
6
−
0
View file @
a5607365
...
@@ -1083,6 +1083,8 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
...
@@ -1083,6 +1083,8 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
cron_line_factory
=
CronLineFactory
()
cron_line_factory
=
CronLineFactory
()
with
open
(
crontab_file
,
'
r
'
)
as
crontab_f
:
with
open
(
crontab_file
,
'
r
'
)
as
crontab_f
:
for
line
in
crontab_f
:
for
line
in
crontab_f
:
missing_newline
=
line
[
-
1
]
!=
"
\n
"
line
=
line
.
strip
()
line
=
line
.
strip
()
line_no
+=
1
line_no
+=
1
...
@@ -1091,5 +1093,9 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
...
@@ -1091,5 +1093,9 @@ def check_crontab(crontab_file, log, whitelisted_users=None):
log
.
Emit
(
line_no
,
line
)
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.
# Summarize the log messages if there were any.
return
log
.
Summary
()
return
log
.
Summary
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment