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

Validation doesn't fail on invalid syntax with EOL comments #33

Closed
knl opened this issue Apr 24, 2020 · 1 comment · Fixed by #46
Closed

Validation doesn't fail on invalid syntax with EOL comments #33

knl opened this issue Apr 24, 2020 · 1 comment · Fixed by #46
Assignees
Labels
bug Something isn't working
Milestone

Comments

@knl
Copy link
Contributor

knl commented Apr 24, 2020

Description

If CODEOWNERS file contains a comment towards the end of the line, the validator doesn't flag it as invalid. In case of such comments, GitHub will skip the rest of the file.

Example:

# This comment is ok
* @someorg/someteam  # this comment is a syntax error

Expected result

I would expect the above snippet to be marked as problematic.

Actual result

env REPOSITORY_PATH="." OWNER_CHECKER_REPOSITORY="someorg/somerepo" CHECKS="files,duppatterns" $(go env GOPATH)/bin/codeowners-validator
==> Executing Duplicated Pattern Checker (30.265µs)
    Check OK
==> Executing File Exist Checker (40.374µs)
    Check OK

Note that I'm not using owners check, as it is not clear what kind of right are needed for the token (but that is a separate issue).

Steps to reproduce

Write a comment after a correct line (so that # is not the first character in the line).

Troubleshooting

@knl knl added the bug Something isn't working label Apr 24, 2020
@mszostok
Copy link
Owner

mszostok commented May 5, 2020

ICYMI: Please see my comment #34 (review) :)

btw. documentation for the token in owners check was added #36

@mszostok mszostok added this to the v0.5.0 milestone May 5, 2020
@mszostok mszostok mentioned this issue Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants