Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mskelton/dtsfmt
Auto formatter for device tree files.
https://github.com/mskelton/dtsfmt
device-tree formatter tree-sitter
Last synced: 4 months ago
JSON representation
Auto formatter for device tree files.
- Host: GitHub
- URL: https://github.com/mskelton/dtsfmt
- Owner: mskelton
- License: isc
- Created: 2023-06-08T12:45:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-05T20:36:31.000Z (5 months ago)
- Last Synced: 2024-10-07T14:54:44.128Z (4 months ago)
- Topics: device-tree, formatter, tree-sitter
- Language: Rust
- Homepage:
- Size: 46.9 KB
- Stars: 13
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dtsfmt
Auto formatter for device tree files.
## Installation
You can install dtsfmt by running the install script which will download
the [latest release](https://github.com/mskelton/dtsfmt/releases/latest).```bash
curl -LSfs https://go.mskelton.dev/dtsfmt/install | sh
```Or you can build from source.
```bash
git clone --recurse-submodules https://github.com/mskelton/dtsfmt.git
cd dtsfmt
cargo install --path .
```## Usage
To run dtsfmt, simply provide a file/directory path to the `dtsfmt` command.
```bash
dtsfmt .
```## Config
The following confirmation options are available for dtsfmt. Confirmation should
be added to a `.dtsfmtrc.toml` file at the root of your project.```toml
layout = "kinesis:adv360"
```## Ignoring code
You can add a `.dtsfmtignore` file at the root of your project to exclude files
and paths from formatting. This file follows the same rules as `.gitignore`.## Flags
### `--check`
When you want to check if your files are formatted, you can run dtsfmt with
the `--check` flag (or `-c`). This will output a human-friendly message and a
list of unformatted files, if any.```bash
dtsfmt --check .
```### `--emit`
You can change the way dtsfmt emits the changes with the `--emit` flag.
```bash
dtsfmt --emit=stdout
```