Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: sample config for toml-sort #618

Closed
jamesbraza opened this issue Oct 23, 2023 · 4 comments · Fixed by #626
Closed

Request: sample config for toml-sort #618

jamesbraza opened this issue Oct 23, 2023 · 4 comments · Fixed by #626
Labels
enhancement New feature or request released Feature/fix is released

Comments

@jamesbraza
Copy link

Problem

I like the tool toml-sort, I find it useful. I use its pre-commit hook toml-sort-fix.

Can we add a sample TOML config for this to resources/?

Possible solution

Here is a pyproject.toml config to use for it:

[tool.tomlsort]
all = true
in_place = true
trailing_comma_inline_array = true

With a .pre-commit-config.yaml integration:

  - repo: https://github.com/pappasam/toml-sort
    rev: v0.23.1
    hooks:
      - id: toml-sort-fix
@jamesbraza jamesbraza added the enhancement New feature or request label Oct 23, 2023
@andreoliwa
Copy link
Owner

andreoliwa commented Oct 24, 2023

Oh, great find, thanks!

Can we add a sample TOML config for this to resources/?

Definitely!

I will try it on Nitpick itself.
I remember seeing some TOML sorting tool some time ago, and I didn't use it because it didn't preserve comments.

@jamesbraza
Copy link
Author

Yeah thanks for being open to it! This is one of the best TOML sorters, from my finding.

I have since learned adding no_sort_tables = true is an important parameter for nitpick configs, since sorted order would move down the nitpick.meta section. I now use:

[tool.tomlsort]
all = true
in_place = true
no_sort_tables = true
trailing_comma_inline_array = true

@jamesbraza
Copy link
Author

jamesbraza commented Nov 4, 2023

Glad you applied toml-sort on this repo too @andreoliwa ! Nice work and thanks

Copy link

🎉 This issue has been resolved in version 0.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Feature/fix is released label Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released Feature/fix is released
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants