summaryrefslogtreecommitdiff
path: root/tools/copyright_checker.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-01-06 19:14:38 -0500
committerGitHub <noreply@github.com>2024-01-06 19:14:38 -0500
commita731647a5198905d439021737eaa8207ca9f7498 (patch)
tree2cbc960f0913b0a9cff926dd849d96c1800745ec /tools/copyright_checker.js
parent1af0daa48705c8ea4af77e01ec68b9fc0fd2aeef (diff)
chore: update LICENSE.md to 2024 (#21833)
Diffstat (limited to 'tools/copyright_checker.js')
-rw-r--r--tools/copyright_checker.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/copyright_checker.js b/tools/copyright_checker.js
index 5e415fcc9..78118cb00 100644
--- a/tools/copyright_checker.js
+++ b/tools/copyright_checker.js
@@ -3,6 +3,8 @@
import { getSources, ROOT_PATH } from "./util.js";
+const copyrightYear = 2024;
+
const buffer = new Uint8Array(1024);
const textDecoder = new TextDecoder();
@@ -49,7 +51,7 @@ export async function checkCopyright() {
const ACCEPTABLE_LINES =
/^(\/\/ deno-lint-.*|\/\/ Copyright.*|\/\/ Ported.*|\s*|#!\/.*)\n/;
const COPYRIGHT_LINE =
- "Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.";
+ `Copyright 2018-${copyrightYear} the Deno authors. All rights reserved. MIT license.`;
const TOML_COPYRIGHT_LINE = "# " + COPYRIGHT_LINE;
const C_STYLE_COPYRIGHT_LINE = "// " + COPYRIGHT_LINE;
@@ -87,6 +89,14 @@ export async function checkCopyright() {
}
}
+ // check the main license file
+ const licenseText = Deno.readTextFileSync(ROOT_PATH + "/LICENSE.md");
+ if (
+ !licenseText.includes(`Copyright 2018-${copyrightYear} the Deno authors`)
+ ) {
+ errors.push(`LICENSE.md has old copyright year`);
+ }
+
if (errors.length > 0) {
// show all the errors at the same time to prevent overlap with
// other running scripts that may be outputting