HubSpot / prettier-maven-plugin

Apache License 2.0
116 stars 23 forks source link

feat add glob parameter, fix #21 #37

Closed GoldSubmarine closed 3 years ago

GoldSubmarine commented 3 years ago

I've already tested it,it works well

GoldSubmarine commented 3 years ago

Is there any response?

GoldSubmarine commented 3 years ago

If anything needs to be modified please let me know.I'm not sure if you agree with the design 😃

jhaber commented 3 years ago

Sorry for the delay, I can review this PR shortly. My main question is how the glob parameter should interact with our regular source directory discovery (should it replace the discovered directories? union the results? filter the directories to files that match this glob?)

GoldSubmarine commented 3 years ago

In my opinion, if the user customizes, all of prettier functions should be provided, not only format java files, but also format markdown or javascript. What files need to be formatted is totally up to him, so we don't have to do anything for the result.

I just test by the absolute path, relative paths are now invalid.

GoldSubmarine commented 3 years ago

Maybe we can modify the startup path of nodejs to the current project root

GoldSubmarine commented 3 years ago

I've already tested it, relative paths also take effect.

GoldSubmarine commented 3 years ago

Perhaps by default, we should format all Java files, so we should remove the following code. Relate to #34

https://github.com/HubSpot/prettier-maven-plugin/blob/41af5f47a4c3a72a373cb7fdc4105d1562bdc82a/src/main/java/com/hubspot/maven/plugins/prettier/AbstractPrettierMojo.java#L148-L149

If users only need to format certain folders, they should customize by glob config. Relate to #22

9inpachi commented 3 years ago

I need this too. Would be great if the PR is merged. :)

mnisius commented 3 years ago

Yes it would be awsome if this plugin could format all of my project. Please merge.

jhaber commented 3 years ago

Sorry again for the delay, I went a slightly different direction in #39 with support for multiple patterns, rather than needing to stuff everything into a single glob