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

chore: add copyright_checker tool and add the missing copyright of … #17285

Merged
merged 8 commits into from
Jan 13, 2023
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
2 changes: 2 additions & 0 deletions bench_util/benches/op_baseline.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::{benchmark_group, Bencher};
use deno_bench_util::{bench_js_async, bench_js_sync};
Expand Down
2 changes: 2 additions & 0 deletions bench_util/benches/utf8.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_bench_util::bench_js_sync_with;
use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::benchmark_group;
Expand Down
2 changes: 2 additions & 0 deletions cli/bench/http/deno_http_flash_ops_spawn.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

if (Deno.build.os !== "linux") {
throw new Error("SO_REUSEPORT is only supported on Linux");
}
Expand Down
2 changes: 2 additions & 0 deletions cli/bench/http/deno_http_flash_spawn.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

if (Deno.build.os !== "linux") {
throw new Error("SO_REUSEPORT is only supported on Linux");
}
Expand Down
2 changes: 2 additions & 0 deletions cli/bench/http/deno_http_native_headers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

const addr = Deno.args[0] || "127.0.0.1:4500";
const [hostname, port] = addr.split(":");
const listener = Deno.listen({ hostname, port: Number(port) });
Expand Down
2 changes: 2 additions & 0 deletions cli/bench/http/deno_http_ops.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

const addr = Deno.args[0] || "127.0.0.1:4500";
const [hostname, port] = addr.split(":");
const tcp = Deno.listen({ hostname, port: Number(port) });
Expand Down
2 changes: 2 additions & 0 deletions cli/bench/http/node_reactdom_ssr.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

var Gd = Object.create;
var Ac = Object.defineProperty;
var Xd = Object.getOwnPropertyDescriptor;
Expand Down
2 changes: 2 additions & 0 deletions cli/bench/napi/bench.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { loadTestLibrary } from "../../../test_napi/common.js";

const lib = loadTestLibrary();
Expand Down
3 changes: 2 additions & 1 deletion cli/bench/stdio/stdio.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// From https://github.com/just-js/benchmarks/tree/main/01-stdio
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
//
// From https://github.com/just-js/benchmarks/tree/main/01-stdio

const blocksize = parseInt(Deno.args[0] || 65536);
const buf = new Uint8Array(blocksize);
Expand Down
2 changes: 2 additions & 0 deletions cli/cache/parsed_source.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use std::collections::HashMap;
use std::path::Path;
use std::path::PathBuf;
Expand Down
2 changes: 2 additions & 0 deletions cli/js.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_core::Snapshot;
use log::debug;
use once_cell::sync::Lazy;
Expand Down
2 changes: 2 additions & 0 deletions cli/lsp/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
Expand Down
16 changes: 10 additions & 6 deletions cli/ops/bench.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::tools::bench::BenchDescription;
use crate::tools::bench::BenchEvent;
use crate::tools::test::TestFilter;
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::time;

use deno_core::error::generic_error;
use deno_core::error::AnyError;
use deno_core::op;
Expand All @@ -12,12 +15,13 @@ use deno_runtime::permissions::ChildPermissionsArg;
use deno_runtime::permissions::PermissionsContainer;
use serde::Deserialize;
use serde::Serialize;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::time;
use tokio::sync::mpsc::UnboundedSender;
use uuid::Uuid;

use crate::tools::bench::BenchDescription;
use crate::tools::bench::BenchEvent;
use crate::tools::test::TestFilter;

pub fn init(
sender: UnboundedSender<BenchEvent>,
filter: TestFilter,
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/abort_controller_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assert, assertEquals } from "./test_util.ts";

Deno.test(function basicAbortController() {
Expand Down
3 changes: 2 additions & 1 deletion cli/tests/unit/command_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import {
assert,
assertEquals,
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/dom_exception_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import {
assertEquals,
assertNotEquals,
Expand Down
3 changes: 2 additions & 1 deletion cli/tests/unit/fs_events_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assert, assertEquals, assertThrows, delay } from "./test_util.ts";

// TODO(ry) Add more tests to specify format.
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/network_interfaces_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assert } from "./test_util.ts";

Deno.test(
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/opcall_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assert, assertStringIncludes, unreachable } from "./test_util.ts";

Deno.test(async function sendAsyncStackTrace() {
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/path_from_url_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assertEquals, assertThrows } from "./test_util.ts";

// @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/read_text_file_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import {
assert,
assertEquals,
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/ref_unref_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assertNotEquals, execCode } from "./test_util.ts";

Deno.test("[unrefOp] unref'ing invalid ops does not have effects", async () => {
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/structured_clone_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assert, assertEquals, assertThrows } from "./test_util.ts";

// Basic tests for the structured clone algorithm. Mainly tests TypeScript
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/version_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assert, assertEquals } from "./test_util.ts";

Deno.test(function version() {
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/wasm_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assert, assertEquals, assertRejects } from "./test_util.ts";

// The following blob can be created by taking the following s-expr and pass
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/webcrypto_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import {
assert,
assertEquals,
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/webgpu_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assert, assertEquals } from "./test_util.ts";

let isCI: boolean;
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/unit/write_text_file_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import {
assert,
assertEquals,
Expand Down
3 changes: 2 additions & 1 deletion cli/tools/coverage/merge.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
//
// Forked from https://github.com/demurgos/v8-coverage/tree/d0ca18da8740198681e0bc68971b0a6cdb11db3e/rust
// Copyright 2021 Charles Samborski. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use super::json_types::CoverageRange;
use super::json_types::FunctionCoverage;
Expand Down
3 changes: 2 additions & 1 deletion cli/tools/coverage/range_tree.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
//
// Forked from https://github.com/demurgos/v8-coverage/tree/d0ca18da8740198681e0bc68971b0a6cdb11db3e/rust
// Copyright 2021 Charles Samborski. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use super::json_types::CoverageRange;
use std::iter::Peekable;
Expand Down
2 changes: 2 additions & 0 deletions cli/util/console.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_runtime::ops::tty::ConsoleSize;

/// Gets the console size.
Expand Down
2 changes: 2 additions & 0 deletions cli/util/path.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use std::borrow::Cow;
use std::path::Path;
use std::path::PathBuf;
Expand Down
2 changes: 2 additions & 0 deletions cli/worker.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use std::path::PathBuf;
use std::rc::Rc;
use std::sync::Arc;
Expand Down
2 changes: 2 additions & 0 deletions core/error_codes.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use anyhow::Error;

pub fn get_error_code(err: &Error) -> Option<&'static str> {
Expand Down
7 changes: 5 additions & 2 deletions core/snapshot_util.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use std::path::Path;
use std::path::PathBuf;

use crate::Extension;
use crate::JsRuntime;
use crate::RuntimeOptions;
use crate::Snapshot;
use std::path::Path;
use std::path::PathBuf;

pub type CompressionCb = dyn Fn(&mut Vec<u8>, &[u8]);

Expand Down
6 changes: 4 additions & 2 deletions ext/broadcast_channel/in_memory_broadcast_channel.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use crate::BroadcastChannel;
use std::sync::Arc;

use async_trait::async_trait;
use deno_core::error::AnyError;
use deno_core::parking_lot::Mutex;
use std::sync::Arc;
use tokio::sync::broadcast;
use tokio::sync::mpsc;
use uuid::Uuid;

use crate::BroadcastChannel;

#[derive(Clone)]
pub struct InMemoryBroadcastChannel(Arc<Mutex<broadcast::Sender<Message>>>);

Expand Down
5 changes: 4 additions & 1 deletion ext/crypto/decrypt.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::shared::*;
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use aes::cipher::block_padding::Pkcs7;
use aes::cipher::BlockDecryptMut;
use aes::cipher::KeyIvInit;
Expand Down Expand Up @@ -29,6 +30,8 @@ use sha2::Sha256;
use sha2::Sha384;
use sha2::Sha512;

use crate::shared::*;

#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DecryptOptions {
Expand Down
2 changes: 2 additions & 0 deletions ext/crypto/ed25519.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_core::error::AnyError;
use deno_core::op;
use deno_core::ZeroCopyBuf;
Expand Down
4 changes: 3 additions & 1 deletion ext/crypto/encrypt.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::shared::*;
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use aes::cipher::block_padding::Pkcs7;
use aes::cipher::BlockEncryptMut;
Expand Down Expand Up @@ -31,6 +31,8 @@ use sha2::Sha256;
use sha2::Sha384;
use sha2::Sha512;

use crate::shared::*;

#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EncryptOptions {
Expand Down
5 changes: 4 additions & 1 deletion ext/crypto/export_key.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::shared::*;
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use const_oid::AssociatedOid;
use const_oid::ObjectIdentifier;
use deno_core::error::custom_error;
Expand All @@ -15,6 +16,8 @@ use spki::der::Decode;
use spki::der::Encode;
use spki::AlgorithmIdentifier;

use crate::shared::*;

#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExportKeyOptions {
Expand Down
5 changes: 4 additions & 1 deletion ext/crypto/generate_key.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::shared::*;
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_core::error::AnyError;
use deno_core::op;
use deno_core::ZeroCopyBuf;
Expand All @@ -12,6 +13,8 @@ use rsa::BigUint;
use rsa::RsaPrivateKey;
use serde::Deserialize;

use crate::shared::*;

// Allowlist for RSA public exponents.
static PUB_EXPONENT_1: Lazy<BigUint> =
Lazy::new(|| BigUint::from_u64(3).unwrap());
Expand Down
7 changes: 5 additions & 2 deletions ext/crypto/import_key.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::key::CryptoNamedCurve;
use crate::shared::*;
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_core::error::AnyError;
use deno_core::op;
use deno_core::ZeroCopyBuf;
Expand All @@ -12,6 +12,9 @@ use serde::Serialize;
use spki::der::Decode;
use spki::der::Encode;

use crate::key::CryptoNamedCurve;
use crate::shared::*;

#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum KeyData {
Expand Down
2 changes: 2 additions & 0 deletions ext/crypto/shared.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use std::borrow::Cow;

use deno_core::error::custom_error;
Expand Down
2 changes: 2 additions & 0 deletions ext/crypto/x25519.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use curve25519_dalek::montgomery::MontgomeryPoint;
use deno_core::error::AnyError;
use deno_core::op;
Expand Down
3 changes: 2 additions & 1 deletion ext/flash/chunked.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
//
// Based on https://github.com/frewsxcv/rust-chunked-transfer/blob/5c08614458580f9e7a85124021006d83ce1ed6e9/src/decoder.rs
// Copyright 2015 The tiny-http Contributors
// Copyright 2015 The rust-chunked-transfer Contributors
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use std::error::Error;
use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion ext/flash/sendfile.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Forked from https://github.com/Thomasdezeeuw/sendfile/blob/024f82cd4dede9048392a5bd6d8afcd4d5aa83d5/src/lib.rs
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Forked from https://github.com/Thomasdezeeuw/sendfile/blob/024f82cd4dede9048392a5bd6d8afcd4d5aa83d5/src/lib.rs

use std::future::Future;
use std::io;
Expand Down
Loading