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

Unchanged files with check annotations #162

Open
KyleSanderson opened this issue Dec 31, 2023 · 3 comments
Open

Unchanged files with check annotations #162

KyleSanderson opened this issue Dec 31, 2023 · 3 comments
Assignees
Labels
driver enhancement New feature or request

Comments

@KyleSanderson
Copy link

So we added nilaway to our github actions flow a couple weeks back (which is great - it makes zero sense why this isn't in the language as fatal). https://github.com/autobrr/autobrr/blob/aa6ac6d4db6ed5a2ba5fd8e3f9bead46674b3e42/.github/workflows/golang-linter.yml#L26

However, on every single PR it reports these Unchanged files with check annotations lines as seemingly a way to punish external to GitHub linters. Other tools seem to be able to change the reporter to github-pr-check from the default to work around the added layer of annoyance, however I'm not seeing such a capability with nilaway presently.

Thoughts, direction, approach, etc appreciated.

@sonalmahajan15 sonalmahajan15 added the needs triaging Requires triaging by the maintainers label Jan 4, 2024
@yuxincs yuxincs added enhancement New feature or request driver and removed needs triaging Requires triaging by the maintainers labels Jan 17, 2024
@yuxincs
Copy link
Contributor

yuxincs commented Jan 17, 2024

I think this is the github actions' logic that has some heuristics that automatically picks up sentences that start with error:.

Seeing one of recent PRs from your repository it seems that it's working sort-of OK now (although it only picks up the first line, where NilAway actually reports the code paths to show the nilness flows)?

We can probably add another formatter to follow Github's workflow commands such that it looks better. But in the meantime you can pass -json to output all NilAway errors in JSON, parse it, and post-process the errors to follow githubs' workflow commands for better presentations.

(Of course, as always, PRs more than welcome!)

@KyleSanderson
Copy link
Author

Kind of sounds like there's nothing out of the box here and it's something that has to be built? I'm coming up short on finding something to parse the json format that this outputs.

@yuxincs
Copy link
Contributor

yuxincs commented Feb 16, 2024

Yes, this has to be built (either as a separate formatter within NilAway, or a custom post-process script on your end).

Running NilAway with -json flag will instruct it to output the results in JSON format, and then you can post-process the output JSON in any way you want :) tools like jq may be handy, or you can write python (or any other language) scripts to do a post process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants