rfc-vote icon indicating copy to clipboard operation
rfc-vote copied to clipboard

Run Pint styling in CI with `--test` flag, or add a pre commit hook

Open brendt opened this issue 2 years ago • 5 comments

So that the action fails if there are issues, without committing.

Reference: https://github.com/brendt/rfc-vote/pull/237#issuecomment-1700755824

brendt avatar Aug 31 '23 12:08 brendt

An alternative to fix this problem is by adding composer qa (pint, phpstan and phpunit) as a pre commit hook. What do people think about it?

brendt avatar Aug 31 '23 12:08 brendt

If it's just the bot making commits to a PR branch causing issues we could set the styling fix workflow to just run when a PR is merged.

on:
  pull_request:
    types:
      - closed

jobs:
  if_merged:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
        # styling fix steps go here...

joshbonnick avatar Aug 31 '23 12:08 joshbonnick

🤔 that's probably the best idea 🫣

brendt avatar Aug 31 '23 12:08 brendt

🤔 that's probably the best idea 🫣

I haven't implemented that way previously, may need to tinker with what branch it targets when fixing styles too.

joshbonnick avatar Aug 31 '23 12:08 joshbonnick

Do you wanna take a look? I'm fine tinkering with it myself if needed :)

brendt avatar Aug 31 '23 18:08 brendt