leptosfmt action

January 26, 2025 ยท View on GitHub

GitHub Marketplace Test leptosfmt action

leptosfmt action

This action downloads and runs leptosfmt on your Rust codebase. See the leptosfmt repository for more information.

Passing arguments

leptosfmt arguments can be passed to the action via the args parameter.

The action also supports some additional arguments.

Inputs

ArgumentDefaultDescription
args./**/*.rs --checkSee Leptosfmt's documentation for all arguments and values
debugfalseEnable debug output in action (set -x). Helpful for troubleshooting
failOnErrortrueFail workflow run on error (i.e. when leptosfmt exit code is not 0)
leptosfmtVersion0.1.32Overwrite the leptosfmt version to be used
outputleptosfmt_output.txtOutput from leptosfmt will be written to this file

Outputs

OutputDescription
exit_codeExit code of leptosfmt

Sample workflow

name: leptosfmt

on:
  workflow_dispatch:
  pull_request:
  push:

jobs:
  leptosfmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: LesnyRumcajs/leptosfmt-action@v0.1.0

Sample workflow with custom arguments

name: leptosfmt

on:
  workflow_dispatch:
  pull_request:
  push:

jobs:
  leptosfmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: leptosfmt
        id: leptosfmt
        uses: LesnyRumcajs/leptosfmt-action@v0.1.0
        with:
          failOnError: false
      - name: print outputs
        if: steps.leptosfmt.outputs.exit_code != 0
        run: |
          cat leptosfmt_output.txt

Reporting issues

If you encounter any issues with this action, please report them here. If the issue is with leptosfmt itself, please report it to the leptosfmt repository.