Skip to content

Commit 80d987c

Browse files
authored
chore: add copyrights header and lint rules (cloudevents#418)
Signed-off-by: Remi Cattiau <[email protected]>
1 parent db4be6b commit 80d987c

29 files changed

+200
-2
lines changed

.eslintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"node": true,
1515
"mocha": true
1616
},
17+
"plugins": [
18+
"header"
19+
],
1720
"rules": {
1821
"no-var": "error",
1922
"standard/no-callback-literal": "off",
@@ -31,6 +34,7 @@
3134
"valid-jsdoc": "warn",
3235
"semi": ["error", "always"],
3336
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
34-
"@typescript-eslint/no-explicit-any": "off"
37+
"@typescript-eslint/no-explicit-any": "off",
38+
"header/header": [2, "block", ["", " Copyright 2021 The CloudEvents Authors"," SPDX-License-Identifier: Apache-2.0", ""], 2]
3539
}
3640
}

cucumber.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
// cucumber.js
27
let common = [
38
"--require-module ts-node/register", // Load TypeScript module

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,62 @@
4242
},
4343
{
4444
"name": "Lance Ball",
45-
"email": "[email protected]"
45+
"email": "[email protected]",
46+
"url": "https://github.com/lance"
47+
},
48+
{
49+
"name": "Lucas Holmquist",
50+
"email": "[email protected]",
51+
"url": "https://github.com/lholmquist"
52+
},
53+
{
54+
"name": "Grant Timmerman",
55+
"url": "https://github.com/grant"
56+
},
57+
{
58+
"name": "Daniel Bevenius",
59+
"email": "[email protected]",
60+
"url": "https://github.com/danbev"
61+
},
62+
{
63+
"name": "Helio Frota",
64+
"url": "https://github.com/helio-frota"
65+
},
66+
{
67+
"name": "Doug Davis",
68+
"email": "[email protected]",
69+
"url": "https://github.com/duglin"
70+
},
71+
{
72+
"name": "Remi Cattiau",
73+
"email": "[email protected]",
74+
"url": "https://github.com/loopingz"
75+
},
76+
{
77+
"name": "Michele Angioni",
78+
"url": "https://github.com/micheleangioni"
79+
},
80+
{
81+
"name": "Ali Ok",
82+
"email": "[email protected]",
83+
"url": "https://github.com/aliok"
84+
},
85+
{
86+
"name": "Philip Hayes",
87+
"url": "https://github.com/deewhyweb"
88+
},
89+
{
90+
"name": "Jingwen Peng",
91+
"url": "https://github.com/pengsrc"
92+
},
93+
{
94+
"name": "Sidharth Vinod",
95+
"email": "[email protected]",
96+
"url": "https://github.com/sidharthv96"
97+
},
98+
{
99+
"name": "Matej Vasek",
100+
"url": "https://github.com/matejvasek"
46101
}
47102
],
48103
"license": "Apache-2.0",
@@ -74,6 +129,7 @@
74129
"eslint": "^7.3.0",
75130
"eslint-config-prettier": "^6.11.0",
76131
"eslint-config-standard": "^14.1.1",
132+
"eslint-plugin-header": "^3.1.1",
77133
"eslint-plugin-import": "^2.20.2",
78134
"eslint-plugin-node": "^11.1.0",
79135
"eslint-plugin-prettier": "^3.1.4",

src/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
const CONSTANTS = Object.freeze({
27
CHARSET_DEFAULT: "utf-8",
38
EXTENSIONS_PREFIX: "ce-",

src/event/cloudevent.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { v4 as uuidv4 } from "uuid";
27
import { Emitter } from "..";
38

src/event/interfaces.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
/**
27
* The object interface for CloudEvents 1.0.
38
* @see https://github.com/cloudevents/spec/blob/v1.0/spec.md

src/event/schemas.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
export const schemaV1 = {
27
$ref: "#/definitions/event",
38
definitions: {

src/event/spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import Ajv from "ajv";
27
import { ValidationError, isBase64 } from "./validation";
38

src/event/validation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { ErrorObject } from "ajv";
27

38
/**

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { CloudEvent, Version } from "./event/cloudevent";
27
import { ValidationError } from "./event/validation";
38
import { CloudEventV03, CloudEventV03Attributes, CloudEventV1, CloudEventV1Attributes } from "./event/interfaces";

src/message/http/headers.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { PassThroughParser, DateParser, MappedParser } from "../../parsers";
27
import { CloudEvent } from "../..";
38
import { Headers } from "../";

src/message/http/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { CloudEvent, CloudEventV03, CloudEventV1, CONSTANTS, Mode, Version } from "../..";
27
import { Message, Headers } from "..";
38

src/message/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { IncomingHttpHeaders } from "http";
27
import { CloudEvent } from "..";
38
import { binary, deserialize, structured, isEvent } from "./http";

src/parsers.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import CONSTANTS from "./constants";
27
import { isString, isDefinedOrThrow, isStringOrObjectOrThrow, ValidationError } from "./event/validation";
38

src/transport/emitter.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { CloudEvent } from "../event/cloudevent";
27
import { HTTP, Message, Mode } from "../message";
38
import { EventEmitter } from "events";

src/transport/http/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { Message, Options } from "../..";
27
import axios from "axios";
38

src/transport/protocols.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
/**
27
* An enum representing the transport protocols for an event
38
*/
9+
410
export const enum Protocol {
511
HTTPBinary,
612
HTTPStructured,

test/conformance/steps.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
/* eslint-disable @typescript-eslint/ban-ts-comment */
7+
28
import { assert } from "chai";
39
import { Given, When, Then, World } from "cucumber";
410
import { Message, Headers, HTTP } from "../../src";

test/integration/cloud_event_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import path from "path";
27
import fs from "fs";
38

test/integration/constants_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import { expect } from "chai";
27
import { CONSTANTS } from "../../src";
38

test/integration/emitter_factory_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import "mocha";
27
import { expect } from "chai";
38
import nock from "nock";

test/integration/emitter_singleton_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import "mocha";
27

38
import { emitterFor, HTTP, Mode, Message, Emitter } from "../../src";

test/integration/message_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import path from "path";
27
import fs from "fs";
38

test/integration/parser_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import "mocha";
27
import { expect } from "chai";
38

test/integration/sdk_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import "mocha";
27
import { expect } from "chai";
38
import { CloudEvent, Version } from "../../src";

test/integration/spec_03_tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import "mocha";
27
import { expect } from "chai";
38
import { CloudEvent, Version, ValidationError, Mode } from "../../src";

test/integration/spec_1_tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import "mocha";
27
import { expect } from "chai";
38
import { CloudEvent, Version, ValidationError } from "../../src";

test/integration/utilities_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright 2021 The CloudEvents Authors
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
16
import "mocha";
27
import { expect } from "chai";
38
import { isStringOrThrow, equalsOrThrow, isBase64, asData } from "../../src/event/validation";

0 commit comments

Comments
 (0)