mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-24 04:46:43 -06:00
改行コードをLFに統一 (#9926)
* chore: update gitattribute editorconfig * Normalize all the line endings
This commit is contained in:
parent
b7b8fd4b59
commit
7436a58ea1
8 changed files with 146 additions and 144 deletions
|
@ -5,6 +5,7 @@ indent_style = tab
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
end_of_line = lf
|
||||||
|
|
||||||
[*.yml]
|
[*.yml]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -5,3 +5,4 @@
|
||||||
*.glb -diff -text
|
*.glb -diff -text
|
||||||
*.blend -diff -text
|
*.blend -diff -text
|
||||||
*.afdesign -diff -text
|
*.afdesign -diff -text
|
||||||
|
* text=auto eol=lf
|
||||||
|
|
36
.github/workflows/check_copyright_year.yml
vendored
36
.github/workflows/check_copyright_year.yml
vendored
|
@ -1,18 +1,18 @@
|
||||||
name: Check copyright year
|
name: Check copyright year
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_copyright_year:
|
check_copyright_year:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.2.0
|
- uses: actions/checkout@v3.2.0
|
||||||
- run: |
|
- run: |
|
||||||
if [ "$(grep Copyright COPYING | sed -e 's/.*2014-\([0-9]*\) .*/\1/g')" -ne "$(date +%Y)" ]; then
|
if [ "$(grep Copyright COPYING | sed -e 's/.*2014-\([0-9]*\) .*/\1/g')" -ne "$(date +%Y)" ]; then
|
||||||
echo "Please change copyright year!"
|
echo "Please change copyright year!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
108
.github/workflows/lint.yml
vendored
108
.github/workflows/lint.yml
vendored
|
@ -1,54 +1,54 @@
|
||||||
name: Lint
|
name: Lint
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pnpm_install:
|
pnpm_install:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v3.3.0
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 7
|
||||||
run_install: false
|
run_install: false
|
||||||
- uses: actions/setup-node@v3.6.0
|
- uses: actions/setup-node@v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- run: pnpm i --frozen-lockfile
|
- run: pnpm i --frozen-lockfile
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
needs: [pnpm_install]
|
needs: [pnpm_install]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
workspace:
|
workspace:
|
||||||
- backend
|
- backend
|
||||||
- frontend
|
- frontend
|
||||||
- sw
|
- sw
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v3.3.0
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 7
|
||||||
run_install: false
|
run_install: false
|
||||||
- uses: actions/setup-node@v3.6.0
|
- uses: actions/setup-node@v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- run: pnpm i --frozen-lockfile
|
- run: pnpm i --frozen-lockfile
|
||||||
- run: pnpm --filter ${{ matrix.workspace }} run lint
|
- run: pnpm --filter ${{ matrix.workspace }} run lint
|
||||||
|
|
|
@ -1,72 +1,72 @@
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import type { ClipNotesRepository, ClipsRepository } from '@/models/index.js';
|
import type { ClipNotesRepository, ClipsRepository } from '@/models/index.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
import { GetterService } from '@/server/api/GetterService.js';
|
import { GetterService } from '@/server/api/GetterService.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['account', 'notes', 'clips'],
|
tags: ['account', 'notes', 'clips'],
|
||||||
|
|
||||||
requireCredential: true,
|
requireCredential: true,
|
||||||
|
|
||||||
kind: 'write:account',
|
kind: 'write:account',
|
||||||
|
|
||||||
errors: {
|
errors: {
|
||||||
noSuchClip: {
|
noSuchClip: {
|
||||||
message: 'No such clip.',
|
message: 'No such clip.',
|
||||||
code: 'NO_SUCH_CLIP',
|
code: 'NO_SUCH_CLIP',
|
||||||
id: 'b80525c6-97f7-49d7-a42d-ebccd49cfd52',
|
id: 'b80525c6-97f7-49d7-a42d-ebccd49cfd52',
|
||||||
},
|
},
|
||||||
|
|
||||||
noSuchNote: {
|
noSuchNote: {
|
||||||
message: 'No such note.',
|
message: 'No such note.',
|
||||||
code: 'NO_SUCH_NOTE',
|
code: 'NO_SUCH_NOTE',
|
||||||
id: 'aff017de-190e-434b-893e-33a9ff5049d8',
|
id: 'aff017de-190e-434b-893e-33a9ff5049d8',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const paramDef = {
|
export const paramDef = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
clipId: { type: 'string', format: 'misskey:id' },
|
clipId: { type: 'string', format: 'misskey:id' },
|
||||||
noteId: { type: 'string', format: 'misskey:id' },
|
noteId: { type: 'string', format: 'misskey:id' },
|
||||||
},
|
},
|
||||||
required: ['clipId', 'noteId'],
|
required: ['clipId', 'noteId'],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-default-export
|
// eslint-disable-next-line import/no-default-export
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.clipsRepository)
|
@Inject(DI.clipsRepository)
|
||||||
private clipsRepository: ClipsRepository,
|
private clipsRepository: ClipsRepository,
|
||||||
|
|
||||||
@Inject(DI.clipNotesRepository)
|
@Inject(DI.clipNotesRepository)
|
||||||
private clipNotesRepository: ClipNotesRepository,
|
private clipNotesRepository: ClipNotesRepository,
|
||||||
|
|
||||||
private getterService: GetterService,
|
private getterService: GetterService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const clip = await this.clipsRepository.findOneBy({
|
const clip = await this.clipsRepository.findOneBy({
|
||||||
id: ps.clipId,
|
id: ps.clipId,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (clip == null) {
|
if (clip == null) {
|
||||||
throw new ApiError(meta.errors.noSuchClip);
|
throw new ApiError(meta.errors.noSuchClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
const note = await this.getterService.getNote(ps.noteId).catch(err => {
|
const note = await this.getterService.getNote(ps.noteId).catch(err => {
|
||||||
if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
|
if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.clipNotesRepository.delete({
|
await this.clipNotesRepository.delete({
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
clipId: clip.id,
|
clipId: clip.id,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 435 B |
Binary file not shown.
Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 435 B |
Binary file not shown.
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 529 B |
Loading…
Reference in a new issue