TAG007: invalid-cron-expression
Scheduled script with an invalid cron expression
| Code | TAG007 |
| Name | invalid-cron-expression |
| Category | Tags and gateway (TAG) |
| Default severity | error |
| Enabled by default | yes |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Checks the cronExpression of gateway scheduled scripts. The gateway uses
five-field cron patterns (minute, hour, day of month, month, day of week),
optionally several joined with |. Each field is * or a comma-separated
list of values and ranges (a-b), each optionally with a step (/n).
Months may be written jan..dec, days of the week sun..sat (0 or 7
is Sunday), and the day of month may be L (last day).
Only clear errors are reported: a wrong number of fields, characters that are not part of the syntax, values out of range and zero steps.
Why is this bad?
Section titled “Why is this bad?”The gateway cannot schedule a script with an invalid pattern, so it never runs.
Example
Section titled “Example”{"attributes": {"cronExpression": "0 2 * *"}}Use instead:
{"attributes": {"cronExpression": "0 2 * * *"}}Generated from the rule metadata by iglint generate-docs; iglint rule TAG007 prints the same page in the terminal. Source: docs/rules/TAG007.md.