ataylorme / eslint-annotate-action

A GitHub action that takes ESLint results from a JSON file and adds them as annotated pull request comments
MIT License
88 stars 32 forks source link

Feature Request: warn when annotations can't be added because of filePath mismatch #50

Closed atsu85 closed 1 year ago

atsu85 commented 1 year ago

Suggestion

Log warning when filePaths from referenced report-json file contain paths that don't match with files in repository.

Background information

I wasted some time until i figured out why this action didn't add linting annotations next to "Files changed" tab of the PR nor to individual commits.

The reason was that since i run linter inside Docker container, not in runner directly, and filePaths of generated report json are absolute paths, not relative, then linting issues could not be correctly correlated to files in the git repository. Hence the annotations didn't appear next to code changes, although they could be viewed from the separate report.

As workaround i started running linter in runner directly, not in Docker container, but for larger projects this approach could be considerably slower. In one of my projects it takes:

Another workaround could have been to replace absolute paths of docker container with absolute paths of runner in report-json file - seemed too much hassle.

ataylorme commented 1 year ago

Another workaround could have been to replace absolute paths of docker container with absolute paths of runner in report-json file - seemed too much hassle.

This action takes a report as an input and I see the path issues as a problem with the report file, not the action.