wearerequired / lint-action

✨ GitHub Action for detecting and auto-fixing lint errors
MIT License
568 stars 136 forks source link

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

Open Christian-Oleson opened 1 year ago

Christian-Oleson commented 1 year ago

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:

Runs the linter with the commands:

- name: Run linters
  uses: wearerequired/lint-action@v2
  with:
      dotnet_format: true
      dotnet_format_args: "./MySolutionName.sln"
github-actions[bot] commented 1 year ago

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.

Christian-Oleson commented 1 year ago

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

ocean90 commented 1 year ago

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

Christian-Oleson commented 1 year ago

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

ocean90 commented 1 year ago

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.

Christian-Oleson commented 1 year ago

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)

ocean90 commented 1 year ago

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

Christian-Oleson commented 1 year ago

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.

ocean90 commented 1 year ago

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

Christian-Oleson commented 1 year ago

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

ocean90 commented 1 year ago

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.

Christian-Oleson commented 1 year ago

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).