Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A GitHub action to install and run treefmt on your repo

License

NotificationsYou must be signed in to change notification settings

isbecker/treefmt-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

This action installs and runstreefmt on your repository.

Currently, if you run this action on a Windows-based runner, it will use the oldertreefmt version 0.6.1.This is because the newer versions oftreefmt are not yet supported on Windows.

I would recommend using a Linux-based runner if you want to use the latest version oftreefmt.I doubt you will need to run this action on Windows anyway, as it is intended for CI/CD pipelines.

Example usage

This example is more or less taken from thetest.ymlworkflow in this repo.

name:Format Codeon:[push, pull_request]jobs:format:runs-on:ubuntu-lateststeps:    -uses:actions/checkout@v2# setup some formatters    -uses:biomejs/setup-biome@v2.2.1    -uses:uncenter/setup-taplo@v1.0.8    -name:Run treefmtuses:isbecker/treefmt-action@v1with:github_token:${{ secrets.GITHUB_TOKEN }}version:'latest'ci:true

Note that you need to set up the formatters you want to use before runningtreefmt.Many formatters are available as actions on the GitHub Marketplace.

Inputs

version

Optional The version oftreefmt to install. Default"latest".

github_token

Required GitHub token for accessing the API.

config_file

Optional Path to thetreefmt configuration file. Default"treefmt.toml".

allow_missing_formatter

Optional Do not exit with error if a configured formatter is missing. Default"false".

working_directory

Optional Run as iftreefmt was started in the specified working directory instead of the current working directory. Default".".

no_cache

Optional Ignore the evaluation cache entirely. Useful for CI. Default"false".

fail_on_change

Optional Exit with error if any changes were made. Useful for CI. Default"false".

formatters

Optional Specify formatters to apply. Defaults to all formatters.

tree_root

Optional The root directory from whichtreefmt will start walking the filesystem.

tree_root_file

Optional File to search for to find the project root (if--tree_root is not passed).

walk

Optional The method used to traverse the files within--tree_root. Supports 'auto', 'git' or 'filesystem'. Default"auto".

verbose

Optional Set the verbosity of logs e.g.-vv. Default"false".

on_unmatched

Optional Log paths that did not match any formatters at the specified log level. Default"warn".

About

A GitHub action to install and run treefmt on your repo

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp