chore: transition to shorter license headers (#6)

Transition from the GPL jumpscare to a more concise header:

	/*
     * Vencord, a Discord client mod
	 * Copyright (c) 2023 Vendicated and contributors
     *
	 * SPDX-License-Identifier: GPL-3.0
     */

Old files still keep the old headers, while eslint will now autofix the new header

Reviewed-on: https://codeberg.org/Ven/cord/pulls/6
Co-authored-by: Rini <rini@rinici.de>
Co-committed-by: Rini <rini@rinici.de>
This commit is contained in:
Rini 2023-08-10 00:17:49 +00:00 committed by Ven
parent 1a62249da6
commit 8b6c8bc0ec
24 changed files with 72 additions and 80 deletions

View file

@ -4,7 +4,7 @@
"ignorePatterns": ["dist", "browser"],
"plugins": [
"@typescript-eslint",
"header",
"simple-header",
"simple-import-sort",
"unused-imports",
"path-alias"
@ -26,35 +26,12 @@
// Since it's only been a month and Vencord has already been stolen
// by random skids who rebranded it to "AlphaCord" and erased all license
// information
"header/header": [
2,
"block",
[
{
"pattern": "!?",
"template": " "
},
" * Vencord, a modification for Discord's desktop app",
{
"pattern": " \\* Copyright \\(c\\) \\d{4}",
"template": " * Copyright (c) 2023 Vendicated and contributors"
},
" *",
" * This program is free software: you can redistribute it and/or modify",
" * it under the terms of the GNU General Public License as published by",
" * the Free Software Foundation, either version 3 of the License, or",
" * (at your option) any later version.",
" *",
" * This program is distributed in the hope that it will be useful,",
" * but WITHOUT ANY WARRANTY; without even the implied warranty of",
" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
" * GNU General Public License for more details.",
" *",
" * You should have received a copy of the GNU General Public License",
" * along with this program. If not, see <https://www.gnu.org/licenses/>.",
""
],
2
"simple-header/header": [
"error",
{
"files": ["scripts/header-new.txt", "scripts/header-old.txt"],
"templates": { "author": [".*", "Vendicated and contributors"] }
}
],
"quotes": ["error", "double", { "avoidEscape": true }],
"jsx-quotes": ["error", "prefer-double"],

View file

@ -11,7 +11,7 @@
"type": "git",
"url": "git+https://github.com/Vendicated/Vencord.git"
},
"license": "GPL-3.0",
"license": "GPL-3.0-or-later",
"author": "Vendicated",
"directories": {
"doc": "docs"
@ -33,6 +33,7 @@
"dependencies": {
"@vap/core": "0.0.12",
"@vap/shiki": "0.10.5",
"eslint-plugin-simple-header": "^1.0.1",
"fflate": "^0.7.4",
"nanoid": "^4.0.2",
"virtual-merge": "^1.0.1"
@ -51,7 +52,6 @@
"esbuild": "^0.15.18",
"eslint": "^8.28.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-path-alias": "^1.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
@ -69,7 +69,8 @@
"pnpm": {
"patchedDependencies": {
"eslint-plugin-path-alias@1.0.0": "patches/eslint-plugin-path-alias@1.0.0.patch",
"eslint@8.28.0": "patches/eslint@8.28.0.patch"
"eslint@8.28.0": "patches/eslint@8.28.0.patch",
"eslint-plugin-simple-header@1.0.1": "patches/eslint-plugin-simple-header@1.0.1.patch"
},
"peerDependencyRules": {
"ignoreMissing": [

View file

@ -0,0 +1,13 @@
diff --git a/src/index.js b/src/index.js
index e8a8ee34fbafe310c75e752d59ba3a56109d67f1..6aecfe40f863823c8b115bca00537fcd78934137 100644
--- a/src/index.js
+++ b/src/index.js
@@ -95,7 +95,7 @@ function create(ctx) {
?? [Array.isArray(options.text) ? options.text.join("\n") : options.text];
/** @type {string} */
- const src = ctx.sourceCode.getText();
+ const src = ctx.getSourceCode().getText();
const srcHeader = findHeader(src, syntax);
const headers = rawHeaders.map((raw) => makeComment(raw, syntax, decor));
const trailingLines = "\n".repeat(src.slice(srcHeader.length).trim() ? 1 + newlines : 1);

View file

@ -1,9 +1,16 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
patchedDependencies:
eslint-plugin-path-alias@1.0.0:
hash: m6sma4g6bh67km3q6igf6uxaja
path: patches/eslint-plugin-path-alias@1.0.0.patch
eslint-plugin-simple-header@1.0.1:
hash: ej6cxkrs2np2767qe2tatjdt54
path: patches/eslint-plugin-simple-header@1.0.1.patch
eslint@8.28.0:
hash: 7wc6icvgtg3uswirb5tpsbjnbe
path: patches/eslint@8.28.0.patch
@ -15,6 +22,9 @@ dependencies:
'@vap/shiki':
specifier: 0.10.5
version: 0.10.5
eslint-plugin-simple-header:
specifier: ^1.0.1
version: 1.0.1(patch_hash=ej6cxkrs2np2767qe2tatjdt54)
fflate:
specifier: ^0.7.4
version: 0.7.4
@ -65,9 +75,6 @@ devDependencies:
eslint-import-resolver-alias:
specifier: ^1.1.2
version: 1.1.2
eslint-plugin-header:
specifier: ^3.1.1
version: 3.1.1(eslint@8.28.0)
eslint-plugin-path-alias:
specifier: ^1.0.0
version: 1.0.0(patch_hash=m6sma4g6bh67km3q6igf6uxaja)(eslint@8.28.0)
@ -1446,17 +1453,6 @@ packages:
optional: true
dev: true
/eslint-plugin-header@3.1.1(eslint@8.28.0):
resolution: {integrity: sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==}
peerDependencies:
eslint: '>=7.7.0'
peerDependenciesMeta:
eslint:
optional: true
dependencies:
eslint: 8.28.0(patch_hash=7wc6icvgtg3uswirb5tpsbjnbe)
dev: true
/eslint-plugin-path-alias@1.0.0(patch_hash=m6sma4g6bh67km3q6igf6uxaja)(eslint@8.28.0):
resolution: {integrity: sha512-FXus57yC+Zd3sMv46pbloXYwFeNVNHJqlACr9V68FG/IzGFBBokGJpmjDbEjpt8ZCeVSndUubeDWWl2A8sCNVQ==}
peerDependencies:
@ -1472,6 +1468,11 @@ packages:
dev: true
patched: true
/eslint-plugin-simple-header@1.0.1(patch_hash=ej6cxkrs2np2767qe2tatjdt54):
resolution: {integrity: sha512-vpTMgF7bOIflnczDmbfTKtYhjTsPLTTjv/whkh1rXtu4Jp2NtvJr57gJB8QOzNjXyh34/D/LA2NY7tZsebKoZg==}
dev: false
patched: true
/eslint-plugin-simple-import-sort@10.0.0(eslint@8.28.0):
resolution: {integrity: sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==}
peerDependencies:

3
scripts/header-new.txt Normal file
View file

@ -0,0 +1,3 @@
Vencord, a Discord client mod
Copyright (c) {year} {author}
SPDX-License-Identifier: GPL-3.0-or-later

17
scripts/header-old.txt Normal file
View file

@ -0,0 +1,17 @@
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) {year} {author}
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

View file

@ -1,20 +1,8 @@
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2022
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Vencord, a Discord client mod
* Copyright (c) 2023 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { IpcEvents } from "@utils/IpcEvents";
import { IpcRes } from "@utils/types";

View file

@ -1,4 +1,4 @@
/* eslint-disable header/header */
/* eslint-disable simple-header/header */
/*!
* idb-keyval v6.2.0

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { openNotificationLogModal } from "@api/Notifications/notificationLog";
import { Settings, useSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles";

View file

@ -1,4 +1,4 @@
/* eslint-disable header/header */
/* eslint-disable simple-header/header */
/*!
* BetterDiscord addon meta parser

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const VENCORD_FILES = [
IS_DISCORD_DESKTOP ? "patcher.js" : "vencordDesktopMain.js",
"preload.js",

View file

@ -1,4 +1,4 @@
/* eslint-disable header/header */
/* eslint-disable simple-header/header */
/*!
* crxToZip

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { findStoreLazy } from "@webpack";
import * as t from "./types/stores";

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export const defaultRules = [
"action_object_map",
"action_type_map",

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "@utils/constants";
import { isNonNullish } from "@utils/guards";
import definePlugin from "@utils/types";

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Review, ReviewDBUser } from "./entities";
import { settings } from "./settings";
import { authorize, showToast } from "./utils";

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { shikiOnigasmSrc, shikiWorkerSrc } from "@utils/dependencies";
import { WorkerClient } from "@vap/core/ipc";
import type { IShikiTheme, IThemedToken } from "@vap/shiki";

View file

@ -1,4 +1,4 @@
/* eslint-disable header/header */
/* eslint-disable simple-header/header */
import React from "react";
const handleClick = async () =>

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Devs } from "@utils/constants";
import { LazyComponent } from "@utils/react";
import definePlugin from "@utils/types";

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*
To generate:
- Visit https://translate.google.com/?sl=auto&tl=en&op=translate

View file

@ -334,7 +334,11 @@ export const Devs = /* #__PURE__*/ Object.freeze({
HypedDomi: {
name: "HypedDomi",
id: 354191516979429376n
}
},
Rini: {
name: "Rini",
id: 1079479184478441643n
},
} satisfies Record<string, Dev>);
// iife so #__PURE__ works correctly

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// eslint-disable-next-line path-alias/no-relative
import { filters, mapMangledModuleLazy, waitFor } from "../webpack";
import type * as t from "./types/menu";