Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.38 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.38 KB

nph Github Action

This action downloads and runs the nph formatter on Nim source code, suggesting changes based on git diff between the repository and the formatted output.

Quickstart

The following snippet shows the action and its default options. You can remove the with section if you're happy with the defaults, though typically you will want to choose a specific version of nph (ie 0.6.1 at the time of writing).

name: Check `nph` formatting

on:
  pull_request:

jobs:
  nph:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Check `nph` formatting
        uses: arnetheduck/nph-action@v1
        with:
          version: latest
          options: "."
          fail: true
          suggest: true
  • version does what you think it does - pick a release but don't include the v!
  • options can be used to pass options to nph - typically, these will be the files or directories that you want to check - . recursively checks all recognised files!
  • fail will fail the job if formatting finds any differences
  • suggest can be used to turn of auto-suggestions

Credits

This action was heavily inspired by rickstaa/action-black!