-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ restore testing, add CI workflow and
README.md
(#16)
* ✅ restore testing, add CI workflow and `README.md` * ⏪ move `example.nu` back into the benches\ folder * ⏪ return benchmarking with `criterion`
- Loading branch information
Showing
15 changed files
with
210 additions
and
454 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# This workflow run when something is pushed on main and it does | ||
# normal checks like in the normal PRs | ||
|
||
# Jobs on pull request | ||
name: CI on main | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format: | ||
name: format rust files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: format files | ||
run: cargo fmt --all --check | ||
|
||
lint: | ||
name: lint all rust files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: Clippy | ||
run: cargo clippy --no-deps | ||
|
||
test: | ||
name: test rust files | ||
strategy: | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
- os: ubuntu-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: run tests | ||
run: cargo test --workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Jobs on pull request | ||
name: Pull request | ||
on: pull_request | ||
|
||
jobs: | ||
format: | ||
name: format rust files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: format files | ||
run: cargo fmt --all --check | ||
|
||
lint: | ||
name: lint all rust files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: Clippy | ||
run: cargo clippy --no-deps | ||
|
||
test: | ||
name: test rust files | ||
strategy: | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
- os: ubuntu-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: run tests | ||
run: cargo test --workspace |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,77 @@ | ||
# Nushell script formatter | ||
<div align="center"> | ||
|
||
## some example formatting | ||
[`g.nu`](examples/g.nu) should get formatted into [`gradient.nu`](examples/gradient.nu) | ||
# `nufmt`: the nushell formatter | ||
|
||
> **Warning** | ||
> these scripts are very much deprecated, see the `0.31.1` version of `nushell`!! | ||
> we're now in `0.74` on latest `main` :muscle: | ||
[![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] | ||
|
||
> **Note** | ||
> true ideal examples *COMING SOON* :wink: | ||
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg?color=brightgreen | ||
[mit-url]: 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/AucaCoyan/nufmt/actions/workflows/main.yml/badge.svg | ||
[ci-url]: https://github.com/AucaCoyan/nufmt/actions/workflows/main.yml | ||
[nushell-badge]: https://img.shields.io/badge/nushell-v0.80.0-green | ||
[nushell-url]: https://crates.io/crates/nu | ||
|
||
</div> | ||
|
||
## 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 <files> --config my-config.json | ||
``` | ||
|
||
or | ||
|
||
```text | ||
nufmt --stdin <string> --config my-stdin-config.json | ||
``` | ||
|
||
- `-h` or `--help` show help and exit | ||
- `-v` or `--version` prints the version and exit | ||
|
||
## Contributing | ||
|
||
Submit an issue, or come and say hi in the [Discord](https://discord.gg/NtAbbGn)! | ||
|
||
You can mention @AucaCoyan who is active on this repo. |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.