awjh / license-check-and-add

license-check-and-add
Apache License 2.0
11 stars 9 forks source link

Cannot add license to Dockerfile in '#' style comments #26

Closed dod38fr closed 3 years ago

dod38fr commented 4 years ago

Hi

Dockerfile is like a shell script and requires comments prefixed by '#'. I cannot find a way to specify a licenseFormats statement that allow license-check-and-add to do that: the added license is always added in a C-style comment ( /* ... */ ).

E.g. this licenseFormats statement does not work:

 "Dockerfile": {
      "eachLine": {
        "prepend": "# "
      }
    }

Did I miss something ?

All the best

j-fontaine commented 4 years ago

I can confirm that I could not get this to work either based on the schema. I was able to use the defaultFormat to accomplish the same goal. For an enhancement, it would be helpful to add a special handling for "explicit file names"

awjh commented 3 years ago

V4.0.0 introduced ability to use ^ in the licenseFormats section. You can therefore reference a Dockerfile using ^Dockerfile