Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: cron parser #19
feat: cron parser #19
Changes from all commits
9442a9b
9fba9c0
93188f4
125e9a2
2b11319
e645c9d
83b96f2
2085e6e
8c5bdd2
04b5bac
2127c8b
b3e8e86
fa1eeb7
85b972e
c801e43
71d6ceb
d1aa972
6004c79
1aca175
63204c5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 23 in cmd/parser/cron_line.go
Codecov / codecov/patch
cmd/parser/cron_line.go#L22-L23
Check warning on line 38 in cmd/parser/cron_line.go
Codecov / codecov/patch
cmd/parser/cron_line.go#L31-L38
Check warning on line 40 in cmd/parser/cron_line.go
Codecov / codecov/patch
cmd/parser/cron_line.go#L40
Check warning on line 32 in cmd/parser/cron_spec.go
Codecov / codecov/patch
cmd/parser/cron_spec.go#L18-L32
Check warning on line 49 in cmd/parser/cron_spec.go
Codecov / codecov/patch
cmd/parser/cron_spec.go#L35-L49
Check warning on line 18 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L17-L18
Check warning on line 24 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L21-L24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for
replaceAll
.The function
replaceAll
is not covered by unit tests. It's crucial to add comprehensive unit tests for this function to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 31 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L27-L31
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for
sanitizeLineBreaker
.The function
sanitizeLineBreaker
is not covered by unit tests. It's crucial to add comprehensive unit tests for this function to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 38 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L34-L38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for
sanitizeEmptyLine
.The function
sanitizeEmptyLine
is not covered by unit tests. It's crucial to add comprehensive unit tests for this function to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 45 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L41-L45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for
sanitizeComments
.The function
sanitizeComments
is not covered by unit tests. It's crucial to add comprehensive unit tests for this function to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 62 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L48-L62
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for
sanitize
.The function
sanitize
is not covered by unit tests. It's crucial to add comprehensive unit tests for this function to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 66 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L65-L66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for
lines
.The function
lines
is not covered by unit tests. It's crucial to add comprehensive unit tests for this function to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 92 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L72-L92
Check warning on line 101 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L94-L101
Check warning on line 104 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L104
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve error handling and logging in
parseAsSpec
.The function
parseAsSpec
handles errors but does not log them, which could make debugging difficult. Consider adding logging before returning errors to provide more context about the failure.Additionally, add unit tests for
parseAsSpec
to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 119 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L110-L119
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate configuration before returning in
ParseConfig
.The method
ParseConfig
constructs a configuration but does not perform any validation on the resulting configuration. It's a good practice to validate the configuration to catch any potential issues before the configuration is used elsewhere.Additionally, add unit tests for
ParseConfig
to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 126 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L122-L126
Check warning on line 138 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L128-L138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for
buildMapper
.The function
buildMapper
is not covered by unit tests. It's crucial to add comprehensive unit tests for this function to ensure its reliability and correctness.Tools
GitHub Check: codecov/patch
Check warning on line 146 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L141-L146
Check warning on line 163 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L149-L163
Check warning on line 166 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L165-L166
Check warning on line 187 in cmd/parser/cron_string.go
Codecov / codecov/patch
cmd/parser/cron_string.go#L169-L187