Skip to content

Commit

Permalink
fix: fix license headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Nov 11, 2024
1 parent 2d16c07 commit 8b3f1a3
Show file tree
Hide file tree
Showing 152 changed files with 455 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ repos:
- "--skip-license-insertion-comment=no-auto-license-header"
types_or:
- python
exclude: ^examples/
- id: insert-license
name: "License MPL-2.0 rust"
args:
Expand All @@ -113,6 +114,7 @@ repos:
- "--skip-license-insertion-comment=@generated"
types_or:
- rust
exclude: ^examples/
- id: insert-license
name: "License MPL-2.0 typescript"
args:
Expand All @@ -123,6 +125,7 @@ repos:
types_or:
- ts
- tsx
exclude: ^examples/
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
hooks:
Expand Down
3 changes: 3 additions & 0 deletions docs/metatype.dev/docs/guides/securing-requests/cors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

# skip:start
from typegraph import typegraph, Policy, t, Graph
from typegraph.graph.params import Cors
Expand Down
3 changes: 3 additions & 0 deletions ghjk.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

// @ts-nocheck: Deno file

import { METATYPE_VERSION, PUBLISHED_VERSION } from "./tools/consts.ts";
Expand Down
3 changes: 3 additions & 0 deletions src/common/src/typegraph/validator/injection.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use indexmap::IndexMap;
use serde_json::Value;

Expand Down
3 changes: 3 additions & 0 deletions src/meta-cli/src/cli/fdk_template.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use async_trait::async_trait;
use clap::{Parser, ValueEnum};

Expand Down
3 changes: 3 additions & 0 deletions src/meta-cli/src/utils/shell_words.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

// no-auto-license-header

/*
Expand Down
2 changes: 2 additions & 0 deletions src/meta-cli/tests/graphs/nested/graph0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Diagnostic, DiagnosticSeverity } from "vscode-languageserver-types";
import { ScopeManager } from "../typescript-semantic/scope.ts";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Parser } from "../parser.ts";
import { ModuleDiagnosticsContext } from "./diagnostics/context.ts";
import { InputType, Runtime } from "./runtimes/mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions src/meta-lsp/ts-language-server/src/analysis/runtimes/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Parser } from "../../parser.ts";
import { ModuleDiagnosticsContext } from "../diagnostics/context.ts";
import { TgType } from "../typescript-semantic/semantic-node.ts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Parser, queryMatches } from "../../parser.ts";
import { ModuleDiagnosticsContext } from "../diagnostics/context.ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Parser } from "../../parser.ts";
import { ModuleDiagnosticsContext } from "../diagnostics/context.ts";
import { asMethodCall } from "./utils/mod.ts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { ScopeManager } from "./scope.ts";
import { SemanticNode } from "./semantic-node.ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Parser } from "../../../parser.ts";

export type MethodCall = {
Expand Down
3 changes: 3 additions & 0 deletions src/meta-lsp/ts-language-server/src/lsp_client.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import child_process from "node:child_process";
import { JSONRPCEndpoint, LspClient } from "ts-lsp-client";

Expand Down
3 changes: 3 additions & 0 deletions src/meta-lsp/ts-language-server/src/parser.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import Parser = require("tree-sitter");
import { typescript as TypeScript } from "tree-sitter-typescript";
import {
Expand Down
3 changes: 3 additions & 0 deletions src/meta-lsp/ts-language-server/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { LspServer } from "./server/index.ts";

const server = new LspServer(["deno", "lsp"]);
Expand Down
3 changes: 3 additions & 0 deletions src/meta-lsp/ts-language-server/src/server/documents.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Connection, TextDocuments } from "vscode-languageserver";
import { TextDocument } from "vscode-languageserver-textdocument";
import { ClientCapabilities } from "./mod.ts";
Expand Down
3 changes: 3 additions & 0 deletions src/meta-lsp/ts-language-server/src/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { LspClient } from "ts-lsp-client";
import { createLspClient } from "../lsp_client.ts";
import {
Expand Down
3 changes: 3 additions & 0 deletions src/meta-lsp/ts-language-server/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Parser } from "../parser.ts";

export type TypegraphDefinition = {
Expand Down
3 changes: 3 additions & 0 deletions src/meta-lsp/ts-language-server/tests/expose_analysis.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { typescript } from "tree-sitter-typescript";
import {
findTypegraphDefinitions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

// TODO use deployed version of metatype in the import map
import { Policy, t, typegraph } from "npm:@typegraph/[email protected]";
import { PythonRuntime } from "npm:@typegraph/[email protected]/runtimes/python";
Expand Down
2 changes: 2 additions & 0 deletions src/meta-lsp/ts-language-server/tests/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
3 changes: 3 additions & 0 deletions src/meta-lsp/vscode-metatype-support/src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { join } from "node:path";
import { ExtensionContext } from "vscode";

Expand Down
3 changes: 3 additions & 0 deletions src/metagen/fixtures/tg.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { WasmRuntime } from "@typegraph/sdk/runtimes/wasm.ts";

Expand Down
3 changes: 3 additions & 0 deletions src/metagen/src/client_py/static/client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

import typing
import dataclasses as dc
import json
Expand Down
3 changes: 3 additions & 0 deletions src/metagen/src/client_ts/static/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

function _selectionToNodeSet(
selection: Selection,
metas: [string, () => NodeMeta][],
Expand Down
3 changes: 3 additions & 0 deletions src/metagen/src/fdk_substantial/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

// TODO: keyword filtering

use crate::interlude::*;
Expand Down
3 changes: 3 additions & 0 deletions src/metagen/src/fdk_substantial/static/substantial.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

from datetime import timedelta
from typing import Any, Callable, Optional
from types import RetryStrategy
Expand Down
3 changes: 3 additions & 0 deletions src/metagen/src/fdk_substantial/static/types.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

from dataclasses import dataclass
from typing import Union

Expand Down
3 changes: 3 additions & 0 deletions src/metagen/src/fdk_substantial/static/workflow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

from substantial import workflow, Context # noqa
from substantial.types import RetryStrategy # noqa

Expand Down
3 changes: 3 additions & 0 deletions src/metagen/src/fdk_typescript/static/fdk.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

export type Ctx = {
parent?: Record<string, unknown>;
/**
Expand Down
3 changes: 3 additions & 0 deletions src/pyrt_wit_wire/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

import importlib
import importlib.abc
import importlib.machinery
Expand Down
3 changes: 3 additions & 0 deletions src/substantial/src/backends/fs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use super::key_value::{Item, KeyValueBackend, KeyValueLike};
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
Expand Down
3 changes: 3 additions & 0 deletions src/substantial/src/backends/key_value.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use super::{Backend, BackendMetadataWriter, NextRun};
use crate::{
converters::{MetadataEvent, MetadataPayload},
Expand Down
3 changes: 3 additions & 0 deletions src/substantial/src/backends/memory.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use super::key_value::{Item, KeyValueBackend, KeyValueLike};
use anyhow::Result;
use chrono::{DateTime, Utc};
Expand Down
3 changes: 3 additions & 0 deletions src/substantial/src/backends/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

Expand Down
3 changes: 3 additions & 0 deletions src/substantial/src/backends/redis.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use std::sync::Mutex;

use super::{Backend, BackendMetadataWriter, NextRun};
Expand Down
3 changes: 3 additions & 0 deletions src/substantial/src/converters.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use std::collections::HashMap;

use anyhow::{bail, Context, Ok, Result};
Expand Down
3 changes: 3 additions & 0 deletions src/substantial/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

pub mod backends;
pub mod converters;
pub mod protocol;
3 changes: 3 additions & 0 deletions src/substantial/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

#[cfg(test)]
mod tests {
use std::{collections::HashMap, fmt::Debug, path::PathBuf, thread::sleep, time::Duration};
Expand Down
3 changes: 3 additions & 0 deletions src/typegate/src/runtimes/substantial/agent.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import {
AddScheduleInput,
Backend,
Expand Down
3 changes: 3 additions & 0 deletions src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
//
// SPDX-License-Identifier: MPL-2.0
Expand Down
3 changes: 3 additions & 0 deletions src/typegraph/core/src/types/type_ref.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use std::hash::Hash;
use std::rc::Rc;

Expand Down
3 changes: 3 additions & 0 deletions src/typegraph/core/src/types/type_ref/as_id.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use serde::{Deserialize, Serialize};

use super::{ExtendedTypeDef, FindAttribute as _, RefAttr, TypeRef};
Expand Down
3 changes: 3 additions & 0 deletions src/typegraph/core/src/types/type_ref/injection.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use super::{RefAttr, TypeRef};
use crate::types::Type;
use crate::wit::utils::ReduceEntry;
Expand Down
3 changes: 3 additions & 0 deletions src/typegraph/core/src/types/type_ref/policy.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use crate::errors::{Result, TgError};
use crate::types::Type;
use serde::{Deserialize, Serialize};
Expand Down
3 changes: 3 additions & 0 deletions src/typegraph/core/src/types/type_ref/runtime_config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use super::{RefAttr, TypeRef};
use crate::errors::{Result, TgError};
use crate::types::Type;
Expand Down
3 changes: 3 additions & 0 deletions src/typegraph/core/src/types/type_ref/xdef.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use super::{FlatTypeRef, FlatTypeRefTarget, RefAttr, RefAttrs, TypeRef};
use crate::errors::Result;
use crate::global_store::Store;
Expand Down
3 changes: 3 additions & 0 deletions src/typegraph/core/src/utils/postprocess/naming.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use std::{
collections::{HashMap, HashSet},
rc::Rc,
Expand Down
3 changes: 3 additions & 0 deletions tests/auth/auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

from typegraph import typegraph, Policy, t, Graph
from typegraph.graph.params import Auth
from typegraph.runtimes.deno import DenoRuntime
Expand Down
3 changes: 3 additions & 0 deletions tests/dedup/dedup_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Meta } from "test-utils/mod.ts";
import { Typegraph } from "@metatype/typegate/typegraph/types.ts";
import { assert, assertEquals } from "@std/assert";
Expand Down
3 changes: 3 additions & 0 deletions tests/docs/how-tos/prog_deploy/prog_deploy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

import os
from os import path

Expand Down
3 changes: 3 additions & 0 deletions tests/docs/how-tos/prog_deploy/prog_remove.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0

# ..
from typegraph.graph.tg_deploy import (
TypegateConnectionOptions,
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/cli/artifacts/ops.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

export function add({ lhs, rhs }: { lhs: number; rhs: number }) {
return lhs + rhs;
}
Loading

0 comments on commit 8b3f1a3

Please sign in to comment.