mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
add missing copyright headers to *.ts
This commit is contained in:
parent
948fc5f777
commit
e520e8df02
29 changed files with 104 additions and 34 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"];
|
||||
|
||||
|
|
|
@ -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 ".";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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[];
|
||||
}
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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}`);
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue