Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nushell/nufmt
https://github.com/nushell/nufmt
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nushell/nufmt
- Owner: nushell
- License: mit
- Created: 2021-09-18T16:07:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-15T11:47:46.000Z (4 months ago)
- Last Synced: 2024-07-15T13:56:32.102Z (4 months ago)
- Language: Nushell
- Size: 85 KB
- Stars: 62
- Watchers: 5
- Forks: 8
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# `nufmt`: the nushell formatter
[![MIT licensed][mit-badge]][mit-url]
[![Discord chat][discord-badge]][discord-url]
[![CI on main][ci-badge]][ci-url]
[![nushell version][nushell-badge]][nushell-url][mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg?color=brightgreen
[mit-url]: https://github.com/nushell/nufmt/blob/main/LICENSE
[discord-badge]: https://img.shields.io/discord/678763474494423051?logo=discord&label=discord&color=brightgreen
[discord-url]: https://discord.gg/NtAbbGn
[ci-badge]: https://github.com/nushell/nufmt/actions/workflows/main.yml/badge.svg
[ci-url]: https://github.com/nushell/nufmt/actions/workflows/main.yml
[nushell-badge]: https://img.shields.io/badge/nushell-v0.88.1-green
[nushell-url]: https://crates.io/crates/nu## Table of contents
- [Status](#status)
- [Usage](#usage)
- [Files](#files)
- [Options](#options)
- [Contributing](#contributing)## Status
This project is still very much in beta. Expect bugs, unconsistent behaviour. Do not use in productive nushell scripts!
Some of the outputs deletes comments, break the functionality of the script or doesn't format at all.
To use the formatter, test it first and use it with caution!.
## Usage
If you still want to use it, or test it to contribute, this is the `--help`.
```text
nufmt [OPTIONS] [FILES] ...
```### Files
`Files` are a list of files. It cannot be used combined with `--stdin`.
You can format many files with one command!. For example:```text
nufmt my-file1.nu my-file2.nu my-file3.nu
```### Options
- `-s` or `--stdin` formats from `stdin`, returns to `stdout` as a String. It cannot be used combined with `files`.
- `-c` or `--config` pass the config file path.
Sample:```text
nufmt --config my-config.json
```or
```text
nufmt --stdin --config my-stdin-config.json
```- `-h` or `--help` show help and exit
- `-v` or `--version` prints the version and exit## Contributing
We have a [contribution guide](docs/CONTRIBUTING.md). If you still have doubts, you can mention @`AucaCoyan` who is active on this repo.