Skip to content

Commit

Permalink
chore: add missing SPDX ID and workflow check (#13570)
Browse files Browse the repository at this point in the history
* chore: add workflow which checks if SPDX ID exists

* chore: add missing SPDX ID in some files

* chore: change trigger condition

* chore: trigger on push

* lint
  • Loading branch information
zyoshoka authored Mar 13, 2024
1 parent 5c1d86b commit 29f6ba6
Show file tree
Hide file tree
Showing 43 changed files with 287 additions and 2 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/check-spdx-license-id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Check SPDX-License-Identifier

on:
push:
branches:
- master
- develop
pull_request:

jobs:
check-spdx-license-id:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Check
run: |
counter=0
search() {
local directory="$1"
find "$directory" -type f \
'(' \
-name "*.cjs" -and -not -name '*.config.cjs' -o \
-name "*.html" -o \
-name "*.js" -and -not -name '*.config.js' -o \
-name "*.mjs" -and -not -name '*.config.mjs' -o \
-name "*.scss" -o \
-name "*.ts" -and -not -name '*.config.ts' -o \
-name "*.vue" \
')' -and \
-not -name '*eslint*'
}
check() {
local file="$1"
if ! (
grep -q "SPDX-FileCopyrightText: syuilo and misskey-project" "$file" ||
grep -q "SPDX-License-Identifier: AGPL-3.0-only" "$file"
); then
echo "Missing: $file"
((counter++))
fi
}
directories=(
"cypress/e2e"
"packages/backend/migration"
"packages/backend/src"
"packages/backend/test"
"packages/frontend/.storybook"
"packages/frontend/@types"
"packages/frontend/lib"
"packages/frontend/public"
"packages/frontend/src"
"packages/frontend/test"
"packages/misskey-bubble-game/src"
"packages/misskey-reversi/src"
"packages/sw/src"
"scripts"
)
for directory in "${directories[@]}"; do
for file in $(search $directory); do
check "$file"
done
done
if [ $counter -gt 0 ]; then
echo "SPDX-License-Identifier is missing in $counter files."
exit 1
else
echo "SPDX-License-Identifier is certainly described in all target files!"
exit 0
fi
5 changes: 5 additions & 0 deletions cypress/e2e/basic.cy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

describe('Before setup instance', () => {
beforeEach(() => {
cy.resetState();
Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/router.cy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

describe('Router transition', () => {
describe('Redirect', () => {
// サーバの初期化。ルートのテストに関しては各describeごとに1度だけ実行で十分だと思う(使いまわした方が早い)
Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/widgets.cy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

/* flaky
describe('After user signed in', () => {
beforeEach(() => {
Expand Down
7 changes: 6 additions & 1 deletion packages/backend/generate_api_json.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { loadConfig } from './built/config.js'
import { genOpenapiSpec } from './built/server/api/openapi/gen-spec.js'
import { writeFileSync } from "node:fs";

const config = loadConfig();
const spec = genOpenapiSpec(config, true);

writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8');
writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8');
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class UserBlacklistAnntena1689325027964 {
name = 'UserBlacklistAnntena1689325027964'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1690417561185-fix-renote-muting.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class FixRenoteMuting1690417561185 {
name = 'FixRenoteMuting1690417561185'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class ChangeCacheRemoteFilesDefault1690417561186 {
name = 'ChangeCacheRemoteFilesDefault1690417561186'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1690417561187-Fix.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class User2faBackupCodes1690569881926 {
name = 'User2faBackupCodes1690569881926'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class RefineAnnouncement1691649257651 {
name = 'RefineAnnouncement1691649257651'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class RefineAnnouncement21691657412740 {
name = 'RefineAnnouncement21691657412740'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1695260774117-verified-links.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class VerifiedLinks1695260774117 {
name = 'VerifiedLinks1695260774117'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1695288787870-following-notify.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class FollowingNotify1695288787870 {
name = 'FollowingNotify1695288787870'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1695440131671-short-name.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class ShortName1695440131671 {
name = 'ShortName1695440131671'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class MutingNotificationTypes1695605508898 {
name = 'MutingNotificationTypes1695605508898'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1695901659683-note-updated-at.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class NoteUpdatedAt1695901659683 {
name = 'NoteUpdatedAt1695901659683'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class UserListMembership1696323464251 {
name = 'UserListMembership1696323464251'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1696331570827-hibernation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class Hibernation1696331570827 {
name = 'Hibernation1696331570827'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1696332072038-clean.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class Clean1696332072038 {
name = 'Clean1696332072038'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/migration/1700383825690-hard-mute.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class HardMute1700383825690 {
name = 'HardMute1700383825690'

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/core/ChannelFollowingService.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { Inject, Injectable, OnModuleInit } from '@nestjs/common';
import Redis from 'ioredis';
import { DI } from '@/di-symbols.js';
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/misc/fastify-hook-handlers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import type { onRequestHookHandler } from 'fastify';

export const handleRequestRedirectToOmitSearch: onRequestHookHandler = (request, reply, done) => {
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/misc/is-pure-renote.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import type { MiNote } from '@/models/Note.js';

export function isPureRenote(note: MiNote): note is MiNote & { renoteId: NonNullable<MiNote['renoteId']> } {
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/misc/loader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export type FetchFunction<K, V> = (key: K) => Promise<V>;

type ResolveReject<V> = Parameters<ConstructorParameters<typeof Promise<V>>[0]>;
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/models/ReversiGame.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from './util/id.js';
import { MiUser } from './User.js';
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/models/json-schema/signin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export const packedSigninSchema = {
type: 'object',
properties: {
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/test/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { initTestDb, sendEnvResetRequest } from './utils.js';

beforeAll(async () => {
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/test/unit/ApMfmService.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import * as assert from 'assert';
import { Test } from '@nestjs/testing';

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/test/unit/misc/loader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { DebounceLoader } from '@/misc/loader.js';

class Mock {
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->

<link rel="preload" href="https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true" as="image" type="image/png" crossorigin="anonymous">
<link rel="preload" href="https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true" as="image" type="image/jpeg" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/@tabler/[email protected]/tabler-icons.min.css">
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/src/components/global/I18n.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<render/>
</template>
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/src/filters/kmg.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export default (v, fractionDigits = 0) => {
if (v == null) return 'N/A';
if (v === 0) return '0';
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/src/scripts/check-reaction-permissions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import * as Misskey from 'misskey-js';
import { UnicodeEmojiDef } from './emojilist.js';

Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/src/scripts/clear-cache.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { unisonReload } from '@/scripts/unison-reload.js';
import * as os from '@/os.js';
import { miLocalStorage } from '@/local-storage.js';
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/src/scripts/code-highlighter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { bundledThemesInfo } from 'shiki';
import { getHighlighterCore, loadWasm } from 'shiki/core';
import darkPlus from 'shiki/themes/dark-plus.mjs';
Expand Down
Loading

0 comments on commit 29f6ba6

Please sign in to comment.