Skip to content

Off-Narrative-Labs/toml_sort

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOML Sort

Simple tool for sorting toml files via cli or ci. It was made with Cargo.toml files in mind but is likely useful elsewhere.

CLI Usage

Installation

cargo install --git https://github.com/Off-Narrative-Labs/toml_sort

Sorting files

toml-sort [files]

Checking sorted files

toml-sort --check [files]

GitHub Action

This will only check ./Cargo.toml:

- uses: Off-Narrative-Labs/toml_sort@v1

If you want the action to check all the TOML files, then you can use:

- uses: Off-Narrative-Labs/toml_sort@v1
  with:
    all: true

🆕 If you want the action to check all the TOML files that match a certain name:

- uses: Off-Narrative-Labs/toml_sort@v1
  with:
    all: true
    match: "Cargo.toml"

In alternative, if you want to check only a certain set of files:

- uses: Off-Narrative-Labs/toml_sort@v1
  with:
    files: Cargo.toml foo/Cargo.toml bar/Cargo.toml

Example

Look no further. This repository itself uses toml sort. Check out the toml-sort.toml file right here in the repository.

Categories

One major motivator for developing this tool is that it will sort your dependencies lexicographically while still respecting your commented in section headings.

[dependencies]
# Common ones
clap = "..."
serde = "..."

# Private things
a-secret-thing = "..."
other-unpublished-stuff = "..."
private-crate = "..."

About

Tool to sort and format TOML files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%