lint-action icon indicating copy to clipboard operation
lint-action copied to clipboard

Linter shows failure, and files which failed linting, but is not making comments on the code in the files via of the PR

Open Christian-Oleson opened this issue 1 year ago • 12 comments

Using an ASP.NET Framework (.NET Framework v4.7.2) solution with many projects (51) in the solution, linting fails to show on the files which have changes violating the editorconfig rules. The linter fails, and by clicking the red x in the PR to see the check failure, the annotations show, but on the files tab of the PR, the annotations are missing. An example of this page is: https://github.com/wearerequired/lint-action/pull/606/files

Tool: dotnet format Action: Runs on windows-latest Pre-requisites: Runs the following:

  • Setup MSBuild
  • Restore Packages
  • Builds Solution

Runs the linter with the commands:

- name: Run linters
  uses: wearerequired/lint-action@v2
  with:
      dotnet_format: true
      dotnet_format_args: "./MySolutionName.sln"

Christian-Oleson avatar Mar 01 '23 18:03 Christian-Oleson

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 17 '23 02:03 github-actions[bot]

This should not be closed since there is yet to be a response.

Christian-Oleson avatar Mar 17 '23 03:03 Christian-Oleson

Hello there, can you further explain how #606 is related to this? Could this be a duplicate of #577?

ocean90 avatar Mar 21 '23 10:03 ocean90

This is not related. I'll try to provide more details. Right now, when I use this action, I can see the action run: image When you look at the details, you can see annotations there: image Yet when you look at the file in the files tab, there are no annotations. However, per the documentation in the readme, there should be annotations: https://github.com/wearerequired/lint-action/blob/master/.github/screenshots/check-annotations.png

Christian-Oleson avatar Mar 21 '23 15:03 Christian-Oleson

What happens when you click on the "Check failure…" link? Looking at https://github.com/wearerequired/lint-action-test/runs/4766567874 and still seems to work.

ocean90 avatar Mar 21 '23 15:03 ocean90

What happens when you click on the "Check failure…" link? Looking at https://github.com/wearerequired/lint-action-test/runs/4766567874 and still seems to work.

Yeah, that works, but you're limited to 50 errors, so if you have more than that, there's no way to see just the errors on your PR nor to see them contextually within your files changed. Having the files changed work allows devs to naturally see the linter messages, which means it is more present in a developers workflow (and thus will be more likely to get fixed)

Christian-Oleson avatar Mar 21 '23 15:03 Christian-Oleson

That's correct, this limitation is forced by GitHub. It's recommended to fix all issues first before using a linter action.

ocean90 avatar Mar 21 '23 15:03 ocean90

That's correct, this limitation is forced by GitHub. It's recommended to fix all issues first before using a linter action.

Right, but even when I fix those errors, it does not show on the files tab.

Christian-Oleson avatar Mar 21 '23 18:03 Christian-Oleson

Do you have an example? https://github.com/wearerequired/lint-action-test/pull/6/files shows them correctly.

ocean90 avatar Mar 24 '23 16:03 ocean90

Yup, here is a repo I published here: https://github.com/Christian-Oleson/lint-action-test

Where the linter ran successfully with errors found here: https://github.com/Christian-Oleson/lint-action-test/pull/1/checks?check_run_id=12352172533

But the files are not adding annotations on the files tab: UnitTest1.cs

Christian-Oleson avatar Mar 29 '23 02:03 Christian-Oleson

Based on the Check failure on line 7 in lint-action-test\UnitTest1.cs message I'd say that this is because of the backslash and GitHub seems to expect a forward slash.

ocean90 avatar Mar 30 '23 08:03 ocean90

Based on the Check failure on line 7 in lint-action-test\UnitTest1.cs message I'd say that this is because of the backslash and GitHub seems to expect a forward slash.

Thanks for catching that. I'm not entirely sure I see where it is failing, but I'll trust you've understood it. It sounds like a windows issue for sure though, which is indicative of where I'm see the problem (windows containers).

Christian-Oleson avatar Mar 30 '23 14:03 Christian-Oleson