B1NARY-GR0UP / nwa

A More Powerful License Header Management Tool
Apache License 2.0
8 stars 3 forks source link

feat: add support for .twig files #4

Closed clemlatz closed 1 month ago

clemlatz commented 1 month ago

What type of PR is this?

optimize: A new optimization

Check the PR title.

More detail description for this PR.

Twig is a template engine & language used in the Symfony framework, among others. It uses {# and #} as delimiting characters for multiline comments.

Note : currently, when trying to add a header to a non supported format, nwa will do nothing but still displays a success message eg

2024/10/24 10:06:32 INFO file has been modified path=src/AppBundle/Resources/views/Article/show.html.twig

I think it would be better to display an error message stating that the format is unsupported, but that goes far beyond my very weak knowledge of Go.

justlorain commented 1 month ago

There is indeed a bug in handling unsupported file formats, and I will fix it later. Thank you for discovering it.

Please resolve the conflicts, and then we can merge this PR.