Unverified Commit bb1f8464 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Manage coyright header for source files

parent c484579f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJ_DIR=`readlink -f ${DIR}/../../`

docker run --rm --volume ${PROJ_DIR}:/usr/src/ osterman/copyright-header:latest \
    --syntax scripts/license/copyright_header_syntax.yml \
    --license-file scripts/license/header \
    --guess-extension \
    --word-wrap 80 \
    --output-dir /usr/src/ \
    --add-path ./src:./include
+225 −0
Original line number Diff line number Diff line
ruby:
  ext: ['.rb', '.rake']
  after: ['^#!', '^#.*encoding:', '^#.*frozen_string_literal:']
  comment:
    open:   '\n#\n'
    close:  '#\n'
    prefix: '# '

perl:
  ext: ['.pl']
  after: ['^#!', '^#.*encoding:']
  comment:
    open:   '#\n'
    close:  '#\n'
    prefix: '# '

# Support PEP 0263 comments:
# coding=<encoding name>
# -*- coding: <encoding name> -*-
# vim: set fileencoding=<encoding name> :
python:
  ext: ['.py']
  after: ['^#!', '^#.*coding:', '^#.*coding=', '^#.*fileencoding=']
  comment:
    open:   '\n'
    close:  '\n'
    prefix: '# '

html:
  ext: ['.html', '.htm', '.xhtml']
  comment:
    open:   '<!--\n'
    close:  '-->\n'
    prefix: '    '

php:
  ext: ['.php']
  after: [ '^#!' ]
  comment:
    open:   '<?php \n/*\n'
    close:  ' */ ?>\n'
    prefix: ' * '

javacript:
  ext: ['.js', '.jsx']
  comment:
    open:   '/*\n'
    close:  ' */\n\n'
    prefix: ' * '

qml:
  ext: ['.qml']
  comment:
    open:   '/*\n'
    close:  ' */\n\n'
    prefix: ' * '

qmake_project:
  ext: ['.pro']
  comment:
    open:   '#\n'
    close:  '#\n'
    prefix: '# '

css:
  ext: ['.css']
  comment:
    open:   '/*\n'
    close:  ' */\n\n'
    prefix: ' * '

c:
  ext: ['.c', '.h']
  comment:
    open:   '/*'
    close:  ' */\n\n'
    prefix: ' * '

cpp:
  ext: ['.cpp', '.hpp', '.cc', '.hh']
  comment:
    open:   '/*\n'
    close:  '*/\n\n'
    prefix: '  '

java:
  ext: ['.java']
  comment:
    open:   '/*\n'
    close:  ' */\n\n'
    prefix: ' * '
    
kotlin:
  ext: ['.kt']
  comment:
    open:   '/*\n'
    clone:  ' */\n\n'
    prefix: ' * '

golang:
  ext: ['.go']
  comment:
    open:   '/*\n'
    close:  ' */\n\n'
    prefix: ' * '

groovy:
  ext: ['.groovy']
  comment:
    open:   '/*\n'
    close:  ' */\n\n'
    prefix: ' * '

haml:
  ext: ['.haml', '.hamlc']
  comment:
    open:   '-#\n'
    close:  '-#\n'
    prefix: '-# '

coffee:
  ext: ['.coffee']
  comment:
    open:   '###\n'
    close:  '###\n'
    prefix: ''

# M4 macro language, use #, not dnl
m4:
  ext:  ['.m4']
  comment:
    open:   '#\n'
    close:  '#\n'
    prefix: '# '

# Most shells, really
shell:
  ext:  ['.sh']
  after: ['^#!']
  comment:
    open:   '#\n'
    close:  '#\n'
    prefix: '# '

# Use "-- " to make sure e.g. MySQL understands it
sql:
  ext:  ['.sql']
  comment:
    open:   '-- \n'
    close:  '-- \n'
    prefix: '-- '

# XML is *not* the same as HTML, and the comments need to go after a
# preprocessing directive, if present.
# FIXME: only supports single line directives
xml:
  ext: ['.xml', '.xsd', '.mxml']
  after: ['^<\?']
  comment:
    open:   '<!--\n'
    close:  '-->\n'
    prefix: '    '

yaml:
  ext:  ['.yml', '.yaml']
  comment:
    open:   '#\n'
    close:  '#\n'
    prefix: '# '

action_script:
  ext: ['.as']
  comment:
    open:   '//\n'
    close:  '//\n\n'
    prefix: '// '

sass:
  ext: ['.sass', '.scss']
  comment:
    open:   '/*\n'
    close:  ' */\n\n'
    prefix: ' * '

verilog:
  ext: ['.v', '.sv']
  comment:
    open:   '//\n'
    close:  '//\n\n'
    prefix: '// '

vhdl:
  ext: ['.vhd']
  comment:
    open:   '--\n'
    close:  '--\n\n'
    prefix: '-- '

elm:
  ext: ['.elm']
  comment:
    open: '{-\n'
    close: '-}\n\n'
    prefix: '  '

swift:
  ext: ['.swift']
  comment:
    open:   '/*\n'
    close:  ' */\n\n'
    prefix: ' * '

rust:
  ext: ['.rs']
  comment:
    open: '/*\n'
    close: ' */\n\n'
    prefix: ' * '
# Conf files i.e. apache config, splunk.conf files
conf:
  ext:  ['.conf']
  comment:
    open:   '#\n'
    close:  '#\n'
    prefix: '# '

scripts/license/header

0 → 100644
+4 −0
Original line number Diff line number Diff line
Copyright 2018-2019, Barcelona Supercomputing Center (BSC), Spain
Copyright 2015-2019, Johannes Gutenberg Universitaet Mainz, Germany

SPDX-License-Identifier: MIT