Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add license headers to files. #511

Merged
merged 2 commits into from
Nov 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
"ignore": ["url"] }
],
"no-return-assign": "off",
"radix": ["error", "as-needed"]
},
"radix": ["error", "as-needed"],
"header/header": [2, "line", [{"pattern": " Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0."}]]},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do we want to handle this date.. manually change it? In other projects we are deriving this from git commit info, so that it says like 2016-2020 on file change.

(feel free to merge without addressing this question)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other projects we are deriving this from git commit info.

That‘s great. and I'm a little confused. Do we really have to keep copyright year and then change it once a year? Personally I suggest we remove copyright Year like other projects. open-telemetry/opentelemetry-java : )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect there's something stronger by saying the year range. However, I'd suggest either do it right or leave it out. I wouldn't necessarily do anything just because otel does though :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing your thought. This is only a suggestion, for reference only. : ).

In other projects we are deriving this from git commit info.

We can try to do this. I know maven plugin can do this (not sure js). It would be better If you can give me a link?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note if we do this, we need a well commented thing on jobs to do full, not shallow git clone. This is a pitfall of using the git range, as it can be inaccurate if for example, you only get the last 5 commits.

"env": {
"node": true,
"jasmine": true
}
},
"plugins": [
"header"
]
}
7 changes: 4 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.
const path = require('path');
const testMiddleware = require('./test/middleware');

Expand All @@ -15,16 +16,16 @@ module.exports = function(config) {
failOnEmptyTestSuite: true,
middleware: ['custom'],
plugins: [
{
{
// This allows http client tests that execute in the browser to be able to hit
// endpoint needed for functional testing such as status code parsing.
//
// Technically, this adds extra endpoints to the karma server (which serves the
// unit tests themselves). Http client tests call relative paths to access these
// endpoints. This is needed because unlike normal node.js tests, we can't start
// a server listener for test endpoints inside the web browser.
'middleware:custom': ['factory', testMiddleware]
},
'middleware:custom': ['factory', testMiddleware]
},
'karma-mocha',
'karma-browserify',
'karma-chai',
Expand Down
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"private": true,
"license": "Apache-2.0",
"dependencies": {
"@babel/preset-env": "^7.3.3"
"@babel/preset-env": "^7.3.3",
"eslint-plugin-header": "^3.1.0"
},
"scripts": {
"install:deps": "lerna exec npm install --no-shrinkwrap",
Expand Down Expand Up @@ -48,6 +49,7 @@
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.2",
"express": "^4.17.0",
"husky": "^4.3.0",
"karma": "^3.1.3",
"karma-browserify": "^6.0.0",
"karma-chai": "^0.1.0",
Expand All @@ -57,6 +59,7 @@
"karma-mocha-reporter": "^2.0.0",
"karma-source-map-support": "^1.3.0",
"lerna": "^3.16.5",
"lint-staged": "^10.5.1",
"lolex": "^1.5.1",
"mocha": "^5.2.0",
"npm-run-all": "^4.1.3",
Expand All @@ -76,5 +79,16 @@
},
"workspaces": [
"packages/*"
]
],
"lint-staged": {
"*.js": [
"eslint --fix .",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
2 changes: 2 additions & 0 deletions packages/zipkin-context-cls/src/CLSContext.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const cls = require('continuation-local-storage');
const clsHooked = require('cls-hooked');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-context-cls/test/CLSContext.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const EventEmitter = require('events');
const CLSContext = require('../');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-encoder-thrift/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {TBinaryProtocol, TBufferedTransport} = require('thrift');
const {InetAddress} = require('zipkin');
const thriftTypes = require('./gen-nodejs/zipkinCore_types');
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-encoder-thrift/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {
TFramedTransport,
TBufferedTransport,
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-axiosjs/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {Instrumentation} = require('zipkin');

function wrapAxios(axios, options = {}) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const axios = require('axios');
const wrapAxios = require('../src/index');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-axiosjs/test/unitTest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {Tracer, ExplicitContext} = require('zipkin');
const axios = require('axios');
const sinon = require('sinon');
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-connect/src/middleware.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {option: {Some, None}, Instrumentation} = require('zipkin');
const url = require('url');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const restify = require('restify');
const express = require('express');
const connect = require('connect');
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-cujojs-rest/src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

module.exports.restInterceptor = require('./restInterceptor');
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

/* eslint-disable no-param-reassign */
const interceptor = require('rest/interceptor');
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const rest = require('rest');
const restInterceptor = require('../src/restInterceptor');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-express/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

import {Handler} from 'express';
import {Tracer} from 'zipkin';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {option: {Some, None}, Instrumentation} = require('zipkin');
const url = require('url');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-express/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const expressMiddleware = require('./expressMiddleware');
const wrapExpressHttpProxy = require('./wrapExpressHttpProxy');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {Request, Annotation} = require('zipkin');
const url = require('url');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const EventEmitter = require('events');
const express = require('express');
const request = require('supertest');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const express = require('express');
const middleware = require('../src/expressMiddleware');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {expect} = require('chai');
const {InetAddress} = require('zipkin');
const fetch = require('node-fetch');
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-fetch/src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

module.exports = require('./wrapFetch');
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-fetch/src/wrapFetch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {
Instrumentation
} = require('zipkin');
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-fetch/test/integrationTest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

// defer lookup of node fetch until we know if we are node
const wrapFetch = require('../src/wrapFetch');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-gotjs/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

import {Tracer} from 'zipkin';

declare function wrapGot(got: any, {
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-gotjs/src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

module.exports = require('./wrapGot');
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-gotjs/src/wrapGot.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {
Instrumentation
} = require('zipkin');
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-gotjs/test/integrationTest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const got = require('got');
const wrapGot = require('../src/wrapGot');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {Annotation, HttpHeaders} = require('zipkin');

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

/* eslint-disable new-cap,no-shadow */
const Instrumentation = require('./grpcClientInstrumentation');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const grpc = require('grpc');
const tracingInterceptor = require('../src/grpcClientInterceptor');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-grpc-client/test/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

/* eslint-disable new-cap */
import grpc from 'grpc';
import * as protoLoader from '@grpc/proto-loader';
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-hapi/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

import {PluginBase} from 'hapi';
import {Tracer} from 'zipkin';

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-hapi/src/hapiMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {option: {Some, None}, Instrumentation} = require('zipkin');
const url = require('url');
const pkg = require('../package.json');
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-hapi/src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

module.exports.hapiMiddleware = require('./hapiMiddleware');
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-hapi/test/integrationTest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const Hapi = require('hapi');
const middleware = require('../src/hapiMiddleware');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-kafkajs/src/kafka-recorder.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {
TraceId, option: {fromNullable}, Annotation, HttpHeaders
} = require('zipkin');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {Request} = require('zipkin');
const {
recordConsumeStop, recordConsumeStart,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {expect} = require('chai');
require('promise.prototype.finally').shim();

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-koa/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

import {Middleware} from 'koa';
import {Tracer} from 'zipkin';

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-koa/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const koaMiddleware = require('./koaMiddleware');

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-koa/src/koaMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {option: {Some, None}, Instrumentation} = require('zipkin');

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const Koa = require('koa');
const koaRoute = require('koa-route');
const https = require('https');
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-memcached/src/zipkinClient.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {Annotation} = require('zipkin');

// TODO: function wrapMemcached(memcached, options = {})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const Memcached = require('memcached');
const zipkinClient = require('../src/zipkinClient');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-postgres/src/zipkinClient.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {Annotation, InetAddress} = require('zipkin');

// TODO: function wrapPostgres(postgres, options = {})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const postgres = require('pg');
const zipkinClient = require('../src/zipkinClient');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-redis/src/zipkinClient.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const {Annotation, InetAddress} = require('zipkin');
const redisCommands = require('redis-commands');

Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-redis/test/integrationTest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const redis = require('redis');
const zipkinClient = require('../src/zipkinClient');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

/* eslint-disable */
// lint disabled until we refactor this file to the point it doesn't crash, or obviate
// by deleting this file.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

import request from 'request-promise';
import {Instrumentation} from 'zipkin';
import {Deferred} from './promise';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

const ZipkinRequest = require('../src/request').default;

const clientFixture = require('../../../test/httpClientTestFixture');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

import {assert} from 'chai';
import {Deferred, Promise as CustomPromise} from '../src/promise';
import {makeTracer} from './utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

import {assert} from 'chai';
import {} from 'co-mocha';
import nock from 'nock';
Expand Down
2 changes: 2 additions & 0 deletions packages/zipkin-instrumentation-request-promise/test/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0.

import {Tracer, ConsoleRecorder} from 'zipkin';
import CLSContext from 'zipkin-context-cls';
import uuid from 'uuid/v4';
Expand Down
Loading