jakemac53 / format

A wrapper around the Dart formatter which supports configuration files
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Is this package useful? Should I publish it? #1

Open jakemac53 opened 1 year ago

jakemac53 commented 1 year ago

cc @ekuleshov @spydon @AndriiMatkivskyiSecurrency @kentcb @mvanbeusekom @felangel @fabriziocacicia @lukepighetti @rockerhieu @brunobowden for comments/suggestions/fyi

I started messing with this package in response to https://github.com/dart-lang/dart_style/issues/864. It is a wrapper around dart format which supports a format.dart.yml file format for configuring includes/excludes, which in particular is cross platform compatible and efficient compared to the other solutions provided there. It runs just as fast as regular dart format in my limited testing.

If I did want to publish it I would probably want to give it a different name than just format as I don't want it to be overly confusing (nor have I even checked if that is available). Name suggestions welcome.

Note that IDE support would also be a TODO, it is a fair bit of effort to integrate it, and can't be easily swapped for the regular formatter, since that is integrated into analysis_server.

You can try it out today by activating it via git dart pub global activate -s git https://github.com/jakemac53/format.git and then running it with dart pub global run format.

spydon commented 1 year ago

Maybe it could use analysis_options.yaml, just with its own section in there?

Should I publish it?

Why not? There are probably a few that is looking for something like this. :)

jakemac53 commented 1 year ago

Maybe it could use analysis_options.yaml, just with its own section in there?

I am actually talking with @DanTup about exactly this, to see if there is any appetite from the analysis_server side of things to support this type configuration. So I will likely hold off on publishing a little bit to see how that shakes out. It would be a much simpler path to IDE support, certainly.

Why not? There are probably a few that is looking for something like this. :)

I mostly just am wondering if this meets the use case for the people on that original issue, and whether there are enough people that would like it to be worth my publishing and supporting it :).

ekuleshov commented 1 year ago

@jakemac53 could it use a section in the pubspec.yaml instead of separate config file? Eg. like https://pub.dev/packages/flutter_launcher_icons does it

jakemac53 commented 1 year ago

@jakemac53 could it use a section in the pubspec.yaml instead of separate config file? Eg. like https://pub.dev/packages/flutter_launcher_icons does it

It could yes but I also want to support more global config (this is how I currently use it). I have just one config file in my home dir that configures all the repos I don't want to format.