Skip to content
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

Treat comments before the package name as the header block #104

Merged
merged 4 commits into from
Dec 14, 2020
Merged

Treat comments before the package name as the header block #104

merged 4 commits into from
Dec 14, 2020

Conversation

jalseth
Copy link
Collaborator

@jalseth jalseth commented Dec 11, 2020

Previously, the @kinds tag was treated as the end of the comment block. This way
the comment block parsing is more stable as we improve the tool and add more
features using the comment block.

Addresses #88

Previously, the @kinds tag was treated as the end of the comment block. This way
the comment block parsing is more stable as we improve the tool and add more
features using the comment block.
internal/rego/rego.go Outdated Show resolved Hide resolved
comments = append(comments, trimString(string(file.Parsed.Comments[c].Text)))
var headerComments, comments []string
for _, c := range file.Parsed.Comments {
if c.Location.Row < file.Parsed.Package.Location.Row {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh I was wondering how that would work. Nice

@jalseth jalseth merged commit 5360a8b into plexsystems:main Dec 14, 2020
@jalseth jalseth deleted the update-comment-block-parsing branch December 14, 2020 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants