add missing copyright headers to *.ts

This commit is contained in:
Damien Elmes 2021-04-13 18:57:08 +10:00
parent 948fc5f777
commit e520e8df02
29 changed files with 104 additions and 34 deletions

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
enum SyncState {
NoChanges = 0,
Normal,

View file

@ -14,6 +14,12 @@ nonstandard_header = {
"qt/aqt/winpaths.py",
}
ignored_folders = [
"bazel-",
"qt/forms",
"ts/node_modules",
]
if not os.path.exists("WORKSPACE"):
print("run from workspace root")
sys.exit(1)
@ -21,22 +27,30 @@ if not os.path.exists("WORKSPACE"):
found = False
for dirpath, dirnames, fnames in os.walk("."):
dir = Path(dirpath)
if "bazel-" in dirpath:
continue
if "qt/forms" in dirpath:
ignore = False
for folder in ignored_folders:
if folder in dirpath:
ignore = True
break
if ignore:
continue
for fname in fnames:
if fname.endswith(".py"):
path = dir / fname
with open(path) as f:
top = f.read(256)
if not top.strip():
continue
if str(path) in nonstandard_header:
continue
if "Ankitects Pty Ltd and contributors" not in top:
print("missing standard copyright header:", path)
found = True
for ext in ".py", ".ts":
if fname.endswith(ext):
path = dir / fname
with open(path) as f:
top = f.read(256)
if not top.strip():
continue
if str(path) in nonstandard_header:
continue
if fname.endswith(".d.ts"):
continue
if "Ankitects Pty Ltd and contributors" not in top:
print("missing standard copyright header:", path)
found = True
if found:
sys.exit(1)

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { EditingArea } from "./editingArea";

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { nodeIsInline } from "./helpers";
function containsInlineContent(field: Element): boolean {

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { Editable } from "./editable";
import { bridgeCommand } from "./lib";

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { EditingArea } from "./editingArea";
import type { LabelContainer } from "./labelContainer";

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { EditingArea } from "./editingArea";

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { EditingArea } from "./editingArea";

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { filterHTML } from "html-filter";

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
// extend the global namespace with our exports - not sure if there's a better way with esbuild
import * as globals from "./index";
for (const key in globals) {

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { EditingArea } from "./editingArea";
import { caretToEnd, nodeIsElement } from "./helpers";

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { bridgeCommand } from "./lib";
import pinIcon from "./pin-angle.svg";

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
declare global {
interface Window {

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let currentNoteId: number | null = null;

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
const highlightButtons = ["bold", "italic", "underline", "superscript", "subscript"];

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { getCurrentField, setFormat } from ".";

View file

@ -1,3 +1,7 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
// languageServerHost taken from MIT sources - see below.
import pb from "anki/backend_proto";
import { getGraphPreferences, setGraphPreferences } from "./graph-helpers";
import { Writable, writable, get } from "svelte/store";

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { isHTMLElement, isNightMode } from "./helpers";
import { removeNode as removeElement } from "./node";
import {

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export function isHTMLElement(elem: Element): elem is HTMLElement {
return elem instanceof HTMLElement;
}

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
test("it should work", () => {
expect("test").toBe("test");
});

View file

@ -1,5 +1,5 @@
/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import {
filterElementBasic,

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export function removeNode(element: Node): void {
element.parentNode?.removeChild(element);
}

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
interface AllowPropertiesBlockValues {
[property: string]: string[];
}

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { naturalUnit, naturalWholeUnit, TimespanUnit } from "./time";
test("natural unit", () => {

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export function assertUnreachable(x: never): never {
throw new Error(`unreachable: ${x}`);
}

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import sqlFormatter from "@sqltools/formatter";
import * as Diff from "diff";
import process from "process";

View file

@ -1,3 +1,7 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
// languageServerHost taken from MIT sources - see below.
const fs = require("fs");
const worker = require("@bazel/worker");
const svelte2tsx = require("svelte2tsx");

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { Readable, readable } from "svelte/store";
interface AsyncData<T, E> {

View file

@ -1,3 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { Readable, derived } from "svelte/store";
interface AsyncReativeData<T, E> {