You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like there to be a function in lib I can call, which would return the applicable above attribute set, depending on which files are found in the repo.
I could then just add treefmt-nix to a project, and it would automatically figure out the required (linter) dependencies and run them.
This would be very helpful, especially for ancillary/config files like *.yaml, *.Make, Dockerfile, etc. which are easily forgotten.
Describe alternatives you've considered
I could get the same behavior by just creating a version of treefmt-nix with all the linters enabled, but for most projects, this would cause a lot of unnecessary dependency bloat.
Additional context
I'd imagine this would depend on there already existing some readily-available "default" mapping between formatter and file extension (i.e. *.md <-> markdownlint or whatever).
I assumed this would already exist somewhere within treefmt or treefmt-nix (otherwise, how can --on-unmatched work?), but I could not find it in the source, so maybe I'm missing something.
I'm way too new to nix to be able to offer to PR this feature, but perhaps if others like it, and I learn more, at some point I could 🙂.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Not a problem, I'm just too lazy to write a lot of, for example, this:
for a bunch of projects.
Describe the solution you'd like
I'd like there to be a function in
lib
I can call, which would return the applicable above attribute set, depending on which files are found in the repo.I could then just add treefmt-nix to a project, and it would automatically figure out the required (linter) dependencies and run them.
This would be very helpful, especially for ancillary/config files like
*.yaml
,*.Make
,Dockerfile
, etc. which are easily forgotten.Describe alternatives you've considered
I could get the same behavior by just creating a version of treefmt-nix with all the linters enabled, but for most projects, this would cause a lot of unnecessary dependency bloat.
Additional context
I'd imagine this would depend on there already existing some readily-available "default" mapping between formatter and file extension (i.e.
*.md
<-> markdownlint or whatever).I assumed this would already exist somewhere within treefmt or treefmt-nix (otherwise, how can
--on-unmatched
work?), but I could not find it in the source, so maybe I'm missing something.I'm way too new to nix to be able to offer to PR this feature, but perhaps if others like it, and I learn more, at some point I could 🙂.
The text was updated successfully, but these errors were encountered: