numtide / treefmt

one CLI to format your repo
https://treefmt.com
MIT License
551 stars 33 forks source link

Smarter init command? #197

Open aldoborrero opened 1 year ago

aldoborrero commented 1 year ago

Rationale

Currently, we can use treefmt --init to create a barebone template of treefmt.toml. But it's a very empty one, having later to customize it by the user.

A better approach could potentially be presented to the user with a wizard option like Yeoman's, where by answering questions (with sane defaults) it can fill semiautomatically the treefmt.toml file for common languages.

zimbatm commented 1 year ago

The init command could auto-detect what languages are being used in the repo and make recommendations based on what is available on the PATH.

The main issue that I see is that it requires maintaining that mapping (and users have to wait for the next release to get it), but it might also encourage users to share their configs.