Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Add a license checking script and add missing headers
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Brown <gary@brownuk.com>
  • Loading branch information
objectiser committed Oct 10, 2017
1 parent 0c62339 commit 757c207
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ test: build-node
npm run flow
npm run lint
npm run test-all
npm run check-license

.PHONY: build-node
build-node: node_modules
Expand Down
12 changes: 12 additions & 0 deletions entrypoint.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under
// the License.

module.exports = {
initTracer: require('./dist/src/configuration.js').default.initTracer,

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@
"underscore": "^1.8.3"
},
"scripts": {
"add-license": "./node_modules/.bin/uber-licence",
"check-license": "./node_modules/.bin/uber-licence --dry",
"check-license": "scripts/checkLicense.sh",
"check-ls": "npm ls --loglevel=http --parseable 1>/dev/null && echo '# npm is in a good state'",
"cover": "babel-node ./node_modules/.bin/babel-istanbul cover ./node_modules/.bin/_mocha -- test/ test/samplers/ test/baggage/",
"coveralls": "npm run cover && cat ./coverage/lcov.info | coveralls",
Expand Down
11 changes: 11 additions & 0 deletions scripts/checkLicense.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
LICENSE="Licensed under the Apache License"

results=`grep -L -r --include \*.js --exclude-dir node_modules --exclude-dir dist "$LICENSE" ./`
if [ ${#results} -eq 0 ]; then
echo "No missing headers"
else
echo "License headers are required in the following files:"
echo "$results"
exit 1
fi
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under
// the License.

import Configuration from './configuration';

module.exports = {
Expand Down
12 changes: 11 additions & 1 deletion test/lib/combinations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

// Copyright (c) 2016 Uber Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under
// the License.

/**
* Example:
Expand Down

0 comments on commit 757c207

Please sign in to comment.