jakartaee / cdi

CDI specification
Apache License 2.0
215 stars 78 forks source link

Document and add copyright headers #756

Closed Azquelt closed 9 months ago

Azquelt commented 10 months ago

When reviewing, please particularly check that I haven't added a copyright header to something that shouldn't have one. The areas I wasn't sure about were:

I haven't changed any headers on existing files and I've used the format that includes the original author's name since some of the files pre-date involvement with the Eclipse Foundation.

Script used to generate headers It's a bit rough, some files needed fixed up by hand, particularly XML ones since the ` tmp.txt mv tmp.txt "$2" } missing_extensions=() for F in $(grep -h ????? target/rat.txt | sed -e 's| !????? ||') ; do data=$(git log --format="%ae %as" $F | tail -1) if [[ $data =~ redhat || $data =~ starksm || $data =~ pmuir || $data =~ antoine || $data =~ marlow || $data =~ gegastaldi || $data =~ ladicek ]] ; then company="Red Hat, Inc." elif [[ $data =~ ibm ]] ; then company="IBM Corp." else echo "No known owner for $F, who is $data" fi year=$(echo $data | cut -d ' ' -f 2 | cut -d '-' -f 1) filename=$(basename "$F") extension="${filename##*.}" if [[ $extension == asciidoc || $extension == adoc ]] ; then header=$(format_header "////" "" "////" "$company" "$year") elif [[ $extension == xml || $extension == html || $extension == md ]] ; then header=$(format_header "" "$company" "$year") elif [[ $extension == yml || $extension == Gemfile || $extension == importorder ]] ; then header=$(format_header "" "# " "" "$company" "$year") elif [[ $extension == java || $extension == policy ]] ; then header=$(format_header "/*" " * " "\\ */" "$company" "$year") else header="Unknown format: $extension" missing_extensions+=("$extension") fi add_header "$header" "$F" done declare -A uniq_ext for ext in "${missing_extensions[@]}" do uniq_ext[$ext]=0 done echo "missing extensions: " "${!uniq_ext[@]}" ```

Fixes #741

Ladicek commented 9 months ago

I think we really should get rid of api/src/ide (which contains jboss_community_formatter.xml). The ide-config module was added by @manovotn in #731 (copied from Weld, which coped it from Quarkus, where it was an original creation, albeit derived -- if not just copied -- from the default Eclipse format IIUC).

manovotn commented 9 months ago

I think we really should get rid of api/src/ide (which contains jboss_community_formatter.xml). The ide-config module was added by @manovotn in #731 (copied from Weld, which coped it from Quarkus, where it was an original creation, albeit derived -- if not just copied -- from the default Eclipse format IIUC).

True, +1 for removing that; I didn't even know it's there, else I'd have removed that as part of the PR you linked :)

Ladicek commented 9 months ago

I was a bit unsure whether the policy format supports /* ... */ comments, because the documentation doesn't mention comments explicitly, it just shows // comments in some examples. However, the implementation of sun.security.provider.PolicyParser shows that both comment styles are supported, so I guess we should be fine.