raygun4node icon indicating copy to clipboard operation
raygun4node copied to clipboard

ci: Prettier setup

Open miquelbeltran opened this issue 10 months ago • 1 comments

ci: Prettier setup

Description :memo:

  • Purpose: Enforces code formatting using the prettier command.
  • Approach: Runs the prettier command in dry mode in pull-requests.

Type of change

  • [x] New feature (non-breaking change which adds functionality)

Updates

  • Add prettier job to the node.js.yml GitHub Actions config file.
  • Add examples to the prettier command in packages.json

TODO: Run prettier on all files to fix current formatting issues. I will have to do this when all current open PRs are merged.

Test plan :test_tube:

  • We will see the results on new PRs opened.

Author to check :eyeglasses:

  • [ ] Project and all contained modules builds successfully
  • [ ] Self-/dev-tested
  • [ ] Unit/UI/Automation/Integration tests provided where applicable
  • [ ] Code is written to standards
  • [ ] Appropriate documentation written (code comments, internal docs)

Reviewer to check :heavy_check_mark:

  • [ ] Project and all contained modules builds successfully
  • [ ] Change has been dev-/reviewer-tested, where possible
  • [ ] Unit/UI/Automation/Integration tests provided where applicable
  • [ ] Code is written to standards
  • [ ] Appropriate documentation written (code comments, internal docs)

miquelbeltran avatar Apr 26 '24 07:04 miquelbeltran

image

This is what we will see when the code is not correctly formatted

miquelbeltran avatar Apr 26 '24 07:04 miquelbeltran

Could you please clarify why we can't do fetch-depth: 1 please

sumitramanga avatar Apr 30 '24 22:04 sumitramanga

Could you please clarify why we can't do fetch-depth: 1 please

Although the prettier GitHub Action asked for it, I ended up removing it and it still seems to work.

I think it is only necessary if we wanted to apply prettier only to the changes done, and not the whole codebase, so it doesn't seem to be necessary in our case.

miquelbeltran avatar May 01 '24 05:05 miquelbeltran