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

leave little warnings or suggestions on PRs when the fourmolu-action fails #1

Open
cdepillabout opened this issue May 31, 2022 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@cdepillabout
Copy link
Collaborator

It would be nice if this Action left comments/warnings/suggestions on PRs on places in the code where the formatting doesn't match what fourmolu suggests.

I think https://github.com/tfausak/hlint-action does have this feature. It would be nice to have something similar here.

@tchoutri
Copy link

It is incredibly difficult today to determine where the fault lies in the codebase, since the Action doesn't say anything about which files are not formatted, neither in the files view, nor in the action interface

Screenshot_20220611_223009

@wraithm
Copy link
Collaborator

wraithm commented Jun 11, 2022 via email

@tchoutri
Copy link

@wraithm Hi, thank you for the quick response! Although I'm still perplex, because the logs as given by Github show me this:

Logs
2022-06-11T20:33:25.9013329Z Requested labels: ubuntu-latest
2022-06-11T20:33:25.9013372Z Job defined at: flora-pm/flora-server/.github/workflows/linting.yml@refs/pull/123/merge
2022-06-11T20:33:25.9013397Z Waiting for a runner to pick up this job...
2022-06-11T20:33:26.7232470Z Job is waiting for a hosted runner to come online.
2022-06-11T20:33:29.7650923Z Job is about to start running on the hosted runner: GitHub Actions 4 (hosted)
2022-06-11T20:33:31.7667149Z Current runner version: '2.292.0'
2022-06-11T20:33:31.7697200Z ##[group]Operating System
2022-06-11T20:33:31.7697946Z Ubuntu
2022-06-11T20:33:31.7698297Z 20.04.4
2022-06-11T20:33:31.7698581Z LTS
2022-06-11T20:33:31.7699056Z ##[endgroup]
2022-06-11T20:33:31.7699465Z ##[group]Virtual Environment
2022-06-11T20:33:31.7699835Z Environment: ubuntu-20.04
2022-06-11T20:33:31.7700211Z Version: 20220605.1
2022-06-11T20:33:31.7700804Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20220605.1/images/linux/Ubuntu2004-Readme.md
2022-06-11T20:33:31.7701508Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20220605.1
2022-06-11T20:33:31.7702056Z ##[endgroup]
2022-06-11T20:33:31.7702458Z ##[group]Virtual Environment Provisioner
2022-06-11T20:33:31.7702823Z 1.0.0.0-main-20220531-1
2022-06-11T20:33:31.7703185Z ##[endgroup]
2022-06-11T20:33:31.7704293Z ##[group]GITHUB_TOKEN Permissions
2022-06-11T20:33:31.7704951Z Actions: write
2022-06-11T20:33:31.7705448Z Checks: write
2022-06-11T20:33:31.7705865Z Contents: write
2022-06-11T20:33:31.7706273Z Deployments: write
2022-06-11T20:33:31.7706592Z Discussions: write
2022-06-11T20:33:31.7706956Z Issues: write
2022-06-11T20:33:31.7707302Z Metadata: read
2022-06-11T20:33:31.7707602Z Packages: write
2022-06-11T20:33:31.7707980Z Pages: write
2022-06-11T20:33:31.7708348Z PullRequests: write
2022-06-11T20:33:31.7708693Z RepositoryProjects: write
2022-06-11T20:33:31.7709092Z SecurityEvents: write
2022-06-11T20:33:31.7709488Z Statuses: write
2022-06-11T20:33:31.7709788Z ##[endgroup]
2022-06-11T20:33:31.7713619Z Secret source: Actions
2022-06-11T20:33:31.7714163Z Prepare workflow directory
2022-06-11T20:33:31.8654385Z Prepare all required actions
2022-06-11T20:33:31.8862235Z Getting action download info
2022-06-11T20:33:32.0725594Z Download action repository 'fourmolu/fourmolu-action@v2' (SHA:e3d94cc70fa37f6014e374e239ae7709357bb5a0)
2022-06-11T20:33:32.7046314Z ##[group]Run fourmolu/fourmolu-action@v2
2022-06-11T20:33:32.7046713Z with:
2022-06-11T20:33:32.7047042Z   pattern: src/**/*.hs
test/**/*.hs
app/**/*.hs

2022-06-11T20:33:32.7047412Z   follow-symbolic-links: true
2022-06-11T20:33:32.7047719Z ##[endgroup]
2022-06-11T20:33:33.8822912Z ##[error]fourmolu detected unformatted files
2022-06-11T20:33:33.9265688Z Cleaning up orphan processes

This is the faulty run. Maybe I'm not looking at the right place?

@wraithm
Copy link
Collaborator

wraithm commented Jun 13, 2022

@tchoutri That's weird! We see the suggestions in our code base... You're definitely looking in the right place. I was mistaken and I'd actually expect it to show up in that place where you took that screen shot, (ie. https://github.com/flora-pm/flora-server/runs/6845560053?check_suite_focus=true).

Hmm...

@cdepillabout
Copy link
Collaborator Author

@tchoutri Thanks for reporting this. That does appear to be a bug, so I've opened up a separate issue to track this: #4

@cdepillabout
Copy link
Collaborator Author

cdepillabout commented Apr 5, 2023

I finally remembered where I saw use of warnings in PRs when an action fails:

https://github.com/cdepillabout/termonad/pull/226/files#diff-ad917605d3fe334f1476885d8cce49546dd9209ca03186e4a92679815177a65d

You can see that the GitHub actions leave a bunch of warnings, and those warnings are shown in the PR overview. It looks like this:

image

The warnings are the Check warning blocks that are inline in the code.

This might be a nice thing to figure out how to do for our fourmolu-action as well.

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

No branches or pull requests

3 participants