Skip to content

Commit d05b292

Browse files
authored
Merge pull request #24462 from opf/code-maintenance/OP-19821-normalize-ts-js-copyright-headers
[OP-19821] Normalize TypeScript and JavaScript copyright headers
2 parents c8e5661 + 08a1a7e commit d05b292

1,560 files changed

Lines changed: 21762 additions & 6277 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.redocly/plugins/custom-rules.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
//-- copyright
2+
// OpenProject is an open source project management software.
3+
// Copyright (C) the OpenProject GmbH
4+
//
5+
// This program is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU General Public License version 3.
7+
//
8+
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
9+
// Copyright (C) 2006-2013 Jean-Philippe Lang
10+
// Copyright (C) 2010-2013 the ChiliProject Team
11+
//
12+
// This program is free software; you can redistribute it and/or
13+
// modify it under the terms of the GNU General Public License
14+
// as published by the Free Software Foundation; either version 2
15+
// of the License, or (at your option) any later version.
16+
//
17+
// This program is distributed in the hope that it will be useful,
18+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
// GNU General Public License for more details.
21+
//
22+
// You should have received a copy of the GNU General Public License
23+
// along with this program; if not, write to the Free Software
24+
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25+
//
26+
// See COPYRIGHT and LICENSE files for more details.
27+
//++
28+
129
import SkipAbbreviatedExamples from './rules/skip-abbreviated-examples.js'
230

331
export default function CustomRulesPlugin() {

.redocly/plugins/rules/skip-abbreviated-examples.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
//-- copyright
2+
// OpenProject is an open source project management software.
3+
// Copyright (C) the OpenProject GmbH
4+
//
5+
// This program is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU General Public License version 3.
7+
//
8+
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
9+
// Copyright (C) 2006-2013 Jean-Philippe Lang
10+
// Copyright (C) 2010-2013 the ChiliProject Team
11+
//
12+
// This program is free software; you can redistribute it and/or
13+
// modify it under the terms of the GNU General Public License
14+
// as published by the Free Software Foundation; either version 2
15+
// of the License, or (at your option) any later version.
16+
//
17+
// This program is distributed in the hope that it will be useful,
18+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
// GNU General Public License for more details.
21+
//
22+
// You should have received a copy of the GNU General Public License
23+
// along with this program; if not, write to the Free Software
24+
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25+
//
26+
// See COPYRIGHT and LICENSE files for more details.
27+
//++
28+
129
function removeNodesWithKey(obj, key) {
230
if (obj === null) return;
331
if (typeof obj === 'string') return;

AGENTS.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,27 @@ erb_lint {files}
7575
bundle exec lefthook install
7676
```
7777

78+
### JavaScript and TypeScript Copyright Headers
79+
80+
All first-party JavaScript and TypeScript files must use the canonical compact
81+
line-comment copyright header generated from `COPYRIGHT_short`:
82+
83+
```typescript
84+
//-- copyright
85+
// OpenProject is an open source project management software.
86+
// ...
87+
//++
88+
89+
```
90+
91+
Use `//-- copyright` and `//++` exactly as shown. Prefix non-empty body lines
92+
with `// `, prefix empty body lines with `//`, and leave one blank line between
93+
the header and the source code. Do not compose or reformat the header manually.
94+
95+
Run `rake copyright:update_typescript` to add or repair headers in `.ts` and
96+
`.tsx` files. Run `rake copyright:update_js` for `.js`, `.mjs`, and `.cjs`
97+
files. Both commands accept an optional path argument.
98+
7899
## Commit Messages
79100
- First line: < 72 characters, then blank line, then detailed description
80101
- Reference work packages when applicable

extensions/op-blocknote-hocuspocus/eslint.config.mjs

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,62 @@
1+
//-- copyright
2+
// OpenProject is an open source project management software.
3+
// Copyright (C) the OpenProject GmbH
4+
//
5+
// This program is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU General Public License version 3.
7+
//
8+
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
9+
// Copyright (C) 2006-2013 Jean-Philippe Lang
10+
// Copyright (C) 2010-2013 the ChiliProject Team
11+
//
12+
// This program is free software; you can redistribute it and/or
13+
// modify it under the terms of the GNU General Public License
14+
// as published by the Free Software Foundation; either version 2
15+
// of the License, or (at your option) any later version.
16+
//
17+
// This program is distributed in the hope that it will be useful,
18+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
// GNU General Public License for more details.
21+
//
22+
// You should have received a copy of the GNU General Public License
23+
// along with this program; if not, write to the Free Software
24+
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25+
//
26+
// See COPYRIGHT and LICENSE files for more details.
27+
//++
28+
129
import js from "@eslint/js";
30+
import { readFileSync } from "node:fs";
231
import globals from "globals";
32+
import { fileURLToPath } from "node:url";
333
import tseslint from "typescript-eslint";
434
import json from "@eslint/json";
535
import { defineConfig } from "eslint/config";
636
import stylistic from "@stylistic/eslint-plugin";
37+
import headers from "eslint-plugin-headers";
38+
39+
const copyrightPath = fileURLToPath(new URL("../../COPYRIGHT_short", import.meta.url));
40+
const copyrightHeader = [
41+
"-- copyright",
42+
...readFileSync(copyrightPath, "utf8")
43+
.trimEnd()
44+
.split(/\r?\n/)
45+
.map((line) => line ? ` ${line}` : ""),
46+
"++",
47+
].join("\n");
748

849
export default defineConfig([
950
{
1051
ignores: ["package-lock.json"],
1152
},
1253
tseslint.configs.recommended,
1354
{
14-
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
55+
files: ["**/*.{js,mjs,cjs,ts,tsx,mts,cts}"],
1556
plugins: {
1657
js,
1758
'@stylistic': stylistic,
59+
headers,
1860
},
1961
extends: ["js/recommended"],
2062
languageOptions: { globals: globals.node },
@@ -27,6 +69,16 @@ export default defineConfig([
2769
}],
2870
"@stylistic/semi": ["warn", "always"],
2971
"@stylistic/indent": ["warn", 2],
72+
"headers/header-format": [
73+
"error",
74+
{
75+
source: "string",
76+
content: copyrightHeader,
77+
style: "line",
78+
linePrefix: "",
79+
trailingNewlines: 2,
80+
},
81+
],
3082
}
3183
},
3284
{

extensions/op-blocknote-hocuspocus/package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/op-blocknote-hocuspocus/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@stylistic/eslint-plugin": "^5.3.1",
3939
"@types/node": "^25.9.5",
4040
"eslint": "^10.6.0",
41+
"eslint-plugin-headers": "^1.3.4",
4142
"globals": "^17.7.0",
4243
"msw": "^2.12.7",
4344
"typescript": "^6.0.3",

extensions/op-blocknote-hocuspocus/src/closeEvents.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
//-- copyright
2+
// OpenProject is an open source project management software.
3+
// Copyright (C) the OpenProject GmbH
4+
//
5+
// This program is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU General Public License version 3.
7+
//
8+
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
9+
// Copyright (C) 2006-2013 Jean-Philippe Lang
10+
// Copyright (C) 2010-2013 the ChiliProject Team
11+
//
12+
// This program is free software; you can redistribute it and/or
13+
// modify it under the terms of the GNU General Public License
14+
// as published by the Free Software Foundation; either version 2
15+
// of the License, or (at your option) any later version.
16+
//
17+
// This program is distributed in the hope that it will be useful,
18+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
// GNU General Public License for more details.
21+
//
22+
// You should have received a copy of the GNU General Public License
23+
// along with this program; if not, write to the Free Software
24+
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25+
//
26+
// See COPYRIGHT and LICENSE files for more details.
27+
//++
28+
129
import type { CloseEvent } from "@hocuspocus/common";
230

331
/**

extensions/op-blocknote-hocuspocus/src/extensions/openProjectApi.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
//-- copyright
2+
// OpenProject is an open source project management software.
3+
// Copyright (C) the OpenProject GmbH
4+
//
5+
// This program is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU General Public License version 3.
7+
//
8+
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
9+
// Copyright (C) 2006-2013 Jean-Philippe Lang
10+
// Copyright (C) 2010-2013 the ChiliProject Team
11+
//
12+
// This program is free software; you can redistribute it and/or
13+
// modify it under the terms of the GNU General Public License
14+
// as published by the Free Software Foundation; either version 2
15+
// of the License, or (at your option) any later version.
16+
//
17+
// This program is distributed in the hope that it will be useful,
18+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
// GNU General Public License for more details.
21+
//
22+
// You should have received a copy of the GNU General Public License
23+
// along with this program; if not, write to the Free Software
24+
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25+
//
26+
// See COPYRIGHT and LICENSE files for more details.
27+
//++
28+
129
import { BlockNoteSchema } from "@blocknote/core";
230
import { ServerBlockNoteEditor } from "@blocknote/server-util";
331
import type { beforeHandleMessagePayload, onAuthenticatePayload, onLoadDocumentPayload, onStoreDocumentPayload, onTokenSyncPayload } from "@hocuspocus/server";

extensions/op-blocknote-hocuspocus/src/index.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
//-- copyright
2+
// OpenProject is an open source project management software.
3+
// Copyright (C) the OpenProject GmbH
4+
//
5+
// This program is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU General Public License version 3.
7+
//
8+
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
9+
// Copyright (C) 2006-2013 Jean-Philippe Lang
10+
// Copyright (C) 2010-2013 the ChiliProject Team
11+
//
12+
// This program is free software; you can redistribute it and/or
13+
// modify it under the terms of the GNU General Public License
14+
// as published by the Free Software Foundation; either version 2
15+
// of the License, or (at your option) any later version.
16+
//
17+
// This program is distributed in the hope that it will be useful,
18+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
// GNU General Public License for more details.
21+
//
22+
// You should have received a copy of the GNU General Public License
23+
// along with this program; if not, write to the Free Software
24+
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25+
//
26+
// See COPYRIGHT and LICENSE files for more details.
27+
//++
28+
129
import { Logger } from "@hocuspocus/extension-logger";
230
import { Server } from "@hocuspocus/server";
331
import { OpenProjectApi } from "./extensions/openProjectApi";

extensions/op-blocknote-hocuspocus/src/services/decryptTokenService.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
//-- copyright
2+
// OpenProject is an open source project management software.
3+
// Copyright (C) the OpenProject GmbH
4+
//
5+
// This program is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU General Public License version 3.
7+
//
8+
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
9+
// Copyright (C) 2006-2013 Jean-Philippe Lang
10+
// Copyright (C) 2010-2013 the ChiliProject Team
11+
//
12+
// This program is free software; you can redistribute it and/or
13+
// modify it under the terms of the GNU General Public License
14+
// as published by the Free Software Foundation; either version 2
15+
// of the License, or (at your option) any later version.
16+
//
17+
// This program is distributed in the hope that it will be useful,
18+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
// GNU General Public License for more details.
21+
//
22+
// You should have received a copy of the GNU General Public License
23+
// along with this program; if not, write to the Free Software
24+
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25+
//
26+
// See COPYRIGHT and LICENSE files for more details.
27+
//++
28+
129
import { createDecipheriv, createHash } from "node:crypto";
230

331
export const ALGORITHM = "aes-256-gcm";

0 commit comments

Comments
 (0)