Skip to content

Commit 06eb6cf

Browse files
committed
Add boilerplate
Signed-off-by: Kaito Udagawa <umireon@kaito.tokyo>
1 parent 9183d84 commit 06eb6cf

63 files changed

Lines changed: 4313 additions & 0 deletions

Some content is hidden

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

.clang-format

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# SPDX-FileCopyrightText: 2018-2026 OBS Project and its contributors
2+
# SPDX-FileCopyrightText: 2026 Kaito Udagawa <umireon@kaito.tokyo>
3+
#
4+
# SPDX-License-Identifier: GPL-3.0-or-later
5+
6+
# please use clang-format version 16 or later
7+
8+
Standard: c++20
9+
AccessModifierOffset: -8
10+
AlignAfterOpenBracket: Align
11+
AlignConsecutiveAssignments: false
12+
AlignConsecutiveDeclarations: false
13+
AlignEscapedNewlines: Left
14+
AlignOperands: true
15+
AlignTrailingComments: true
16+
AllowAllArgumentsOnNextLine: false
17+
AllowAllConstructorInitializersOnNextLine: false
18+
AllowAllParametersOfDeclarationOnNextLine: false
19+
AllowShortBlocksOnASingleLine: false
20+
AllowShortCaseLabelsOnASingleLine: false
21+
AllowShortFunctionsOnASingleLine: Inline
22+
AllowShortIfStatementsOnASingleLine: false
23+
AllowShortLambdasOnASingleLine: Inline
24+
AllowShortLoopsOnASingleLine: false
25+
AlwaysBreakAfterDefinitionReturnType: None
26+
AlwaysBreakAfterReturnType: None
27+
AlwaysBreakBeforeMultilineStrings: false
28+
AlwaysBreakTemplateDeclarations: false
29+
BinPackArguments: true
30+
BinPackParameters: true
31+
BraceWrapping:
32+
AfterClass: false
33+
AfterControlStatement: false
34+
AfterEnum: false
35+
AfterFunction: true
36+
AfterNamespace: false
37+
AfterObjCDeclaration: false
38+
AfterStruct: false
39+
AfterUnion: false
40+
AfterExternBlock: false
41+
BeforeCatch: false
42+
BeforeElse: false
43+
IndentBraces: false
44+
SplitEmptyFunction: true
45+
SplitEmptyRecord: true
46+
SplitEmptyNamespace: true
47+
BreakBeforeBinaryOperators: None
48+
BreakBeforeBraces: Custom
49+
BreakBeforeTernaryOperators: true
50+
BreakConstructorInitializers: BeforeColon
51+
BreakStringLiterals: false # apparently unpredictable
52+
ColumnLimit: 120
53+
CompactNamespaces: false
54+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
55+
ConstructorInitializerIndentWidth: 8
56+
ContinuationIndentWidth: 8
57+
Cpp11BracedListStyle: true
58+
DerivePointerAlignment: false
59+
DisableFormat: false
60+
FixNamespaceComments: true
61+
ForEachMacros:
62+
- 'json_object_foreach'
63+
- 'json_object_foreach_safe'
64+
- 'json_array_foreach'
65+
- 'HASH_ITER'
66+
IncludeBlocks: Preserve
67+
IndentCaseLabels: false
68+
IndentPPDirectives: None
69+
IndentWidth: 8
70+
IndentWrappedFunctionNames: false
71+
KeepEmptyLinesAtTheStartOfBlocks: true
72+
MaxEmptyLinesToKeep: 1
73+
NamespaceIndentation: None
74+
ObjCBinPackProtocolList: Auto
75+
ObjCBlockIndentWidth: 8
76+
ObjCSpaceAfterProperty: true
77+
ObjCSpaceBeforeProtocolList: true
78+
79+
PenaltyBreakAssignment: 10
80+
PenaltyBreakBeforeFirstCallParameter: 30
81+
PenaltyBreakComment: 10
82+
PenaltyBreakFirstLessLess: 0
83+
PenaltyBreakString: 10
84+
PenaltyExcessCharacter: 100
85+
PenaltyReturnTypeOnItsOwnLine: 60
86+
87+
PointerAlignment: Right
88+
ReflowComments: false
89+
SkipMacroDefinitionBody: true
90+
SortIncludes: false
91+
SortUsingDeclarations: false
92+
SpaceAfterCStyleCast: false
93+
SpaceAfterLogicalNot: false
94+
SpaceAfterTemplateKeyword: false
95+
SpaceBeforeAssignmentOperators: true
96+
SpaceBeforeCtorInitializerColon: true
97+
SpaceBeforeInheritanceColon: true
98+
SpaceBeforeParens: ControlStatements
99+
SpaceBeforeRangeBasedForLoopColon: true
100+
SpaceInEmptyParentheses: false
101+
SpacesBeforeTrailingComments: 1
102+
SpacesInAngles: false
103+
SpacesInCStyleCastParentheses: false
104+
SpacesInContainerLiterals: false
105+
SpacesInParentheses: false
106+
SpacesInSquareBrackets: false
107+
StatementMacros:
108+
- 'Q_OBJECT'
109+
TabWidth: 8
110+
TypenameMacros:
111+
- 'DARRAY'
112+
UseTab: ForContinuationAndIndentation
113+
---
114+
Language: ObjC
115+
AccessModifierOffset: 2
116+
AlignArrayOfStructures: Right
117+
AlignConsecutiveAssignments: None
118+
AlignConsecutiveBitFields: None
119+
AlignConsecutiveDeclarations: None
120+
AlignConsecutiveMacros:
121+
Enabled: true
122+
AcrossEmptyLines: false
123+
AcrossComments: true
124+
AllowShortBlocksOnASingleLine: Never
125+
AllowShortEnumsOnASingleLine: false
126+
AllowShortFunctionsOnASingleLine: Empty
127+
AllowShortIfStatementsOnASingleLine: Never
128+
AllowShortLambdasOnASingleLine: None
129+
AttributeMacros: ['__unused', '__autoreleasing', '_Nonnull', '__bridge']
130+
BitFieldColonSpacing: Both
131+
#BreakBeforeBraces: Webkit
132+
BreakBeforeBraces: Custom
133+
BraceWrapping:
134+
AfterCaseLabel: false
135+
AfterClass: true
136+
AfterControlStatement: Never
137+
AfterEnum: false
138+
AfterFunction: true
139+
AfterNamespace: false
140+
AfterObjCDeclaration: false
141+
AfterStruct: false
142+
AfterUnion: false
143+
AfterExternBlock: false
144+
BeforeCatch: false
145+
BeforeElse: false
146+
BeforeLambdaBody: false
147+
BeforeWhile: false
148+
IndentBraces: false
149+
SplitEmptyFunction: false
150+
SplitEmptyRecord: false
151+
SplitEmptyNamespace: true
152+
BreakAfterAttributes: Never
153+
BreakArrays: false
154+
BreakBeforeConceptDeclarations: Allowed
155+
BreakBeforeInlineASMColon: OnlyMultiline
156+
BreakConstructorInitializers: AfterColon
157+
BreakInheritanceList: AfterComma
158+
ColumnLimit: 120
159+
ConstructorInitializerIndentWidth: 4
160+
ContinuationIndentWidth: 4
161+
EmptyLineAfterAccessModifier: Never
162+
EmptyLineBeforeAccessModifier: LogicalBlock
163+
ExperimentalAutoDetectBinPacking: false
164+
FixNamespaceComments: true
165+
IndentAccessModifiers: false
166+
IndentCaseBlocks: false
167+
IndentCaseLabels: true
168+
IndentExternBlock: Indent
169+
IndentGotoLabels: false
170+
IndentRequiresClause: true
171+
IndentWidth: 4
172+
IndentWrappedFunctionNames: true
173+
InsertBraces: false
174+
InsertNewlineAtEOF: true
175+
KeepEmptyLinesAtTheStartOfBlocks: false
176+
LambdaBodyIndentation: Signature
177+
NamespaceIndentation: All
178+
ObjCBinPackProtocolList: Auto
179+
ObjCBlockIndentWidth: 4
180+
ObjCBreakBeforeNestedBlockParam: false
181+
ObjCSpaceAfterProperty: true
182+
ObjCSpaceBeforeProtocolList: true
183+
PPIndentWidth: -1
184+
PackConstructorInitializers: NextLine
185+
QualifierAlignment: Leave
186+
ReferenceAlignment: Right
187+
RemoveSemicolon: false
188+
RequiresClausePosition: WithPreceding
189+
RequiresExpressionIndentation: OuterScope
190+
SeparateDefinitionBlocks: Leave
191+
ShortNamespaceLines: 1
192+
SortIncludes: false
193+
#SortUsingDeclarations: LexicographicNumeric
194+
SortUsingDeclarations: true
195+
SpaceAfterCStyleCast: true
196+
SpaceAfterLogicalNot: false
197+
SpaceAroundPointerQualifiers: Default
198+
SpaceBeforeCaseColon: false
199+
SpaceBeforeCpp11BracedList: true
200+
SpaceBeforeCtorInitializerColon: true
201+
SpaceBeforeInheritanceColon: true
202+
SpaceBeforeParens: ControlStatements
203+
SpaceBeforeRangeBasedForLoopColon: true
204+
SpaceBeforeSquareBrackets: false
205+
SpaceInEmptyBlock: false
206+
SpaceInEmptyParentheses: false
207+
SpacesBeforeTrailingComments: 2
208+
SpacesInConditionalStatement: false
209+
SpacesInLineCommentPrefix:
210+
Minimum: 1
211+
Maximum: -1
212+
Standard: c++20
213+
TabWidth: 4
214+
UseTab: Never

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-FileCopyrightText: 2026 Kaito Udagawa <umireon@kaito.tokyo>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.{c,h,cpp,hpp}]
16+
indent_style = tab
17+
indent_size = 8
18+
tab_width = 8
19+
20+
[.gitconfig*]
21+
indent_style = space
22+
indent_size = 8
23+
24+
[*.md]
25+
trim_trailing_whitespace = false

.gersemirc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json
2+
3+
# SPDX-FileCopyrightText: 2018-2026 OBS Project and its contributors
4+
# SPDX-FileCopyrightText: 2026 Kaito Udagawa <umireon@kaito.tokyo>
5+
#
6+
# SPDX-License-Identifier: GPL-3.0-or-later
7+
8+
definitions: []
9+
line_length: 120
10+
indent: 2
11+
list_expansion: favour-inlining
12+
unsafe: false
13+
warn_about_unknown_commands: false
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-FileCopyrightText: 2026 Kaito Udagawa <umireon@kaito.tokyo>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Extract buildspec
6+
description: Extract and output plugin buildspec.
7+
8+
# file: .github/actions/extract-buildspec/action.yml
9+
# author: Kaito Udagawa <umireon@kaito.tokyo>
10+
# version: 1.1.0
11+
# date: 2026-03-30
12+
13+
inputs:
14+
path:
15+
description: Path to buildspec.json.
16+
required: false
17+
default: buildspec.json
18+
19+
outputs:
20+
BUNDLE_ID:
21+
description: .platformConfig.macos.bundleId from buildspec.json
22+
value: ${{ fromJSON(steps.extract.outputs.JSON).platformConfig.macos.bundleId }}
23+
DISPLAY_NAME:
24+
description: .displayName from buildspec.json
25+
value: ${{ fromJSON(steps.extract.outputs.JSON).displayName }}
26+
NAME:
27+
description: .name from buildspec.json
28+
value: ${{ fromJSON(steps.extract.outputs.JSON).name }}
29+
VERSION:
30+
description: .version from buildspec.json
31+
value: ${{ fromJSON(steps.extract.outputs.JSON).version }}
32+
33+
runs:
34+
using: composite
35+
steps:
36+
- name: Extract plugin buildspec
37+
id: extract
38+
shell: bash --noprofile --norc -euo pipefail -O nullglob {0}
39+
env:
40+
INPUT_PATH: '${{ inputs.path }}'
41+
run: |
42+
printf 'JSON=%s\n' "$(jq -c . "$INPUT_PATH")" >> "$GITHUB_OUTPUT"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# SPDX-FileCopyrightText: 2026 Kaito Udagawa <umireon@kaito.tokyo>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Set up macOS Code Signing
6+
description: Configure code signing for macOS.
7+
8+
# file: .github/actions/setup-macos-codesigning/action.yml
9+
# author: Kaito Udagawa <umireon@kaito.tokyo>
10+
# version: 1.1.0
11+
# date: 2026-03-30
12+
13+
inputs:
14+
MACOS_SIGNING_APPLICATION_IDENTITY:
15+
description: Application Identity for code signing.
16+
required: true
17+
MACOS_SIGNING_CERT:
18+
description: Base64 encoded .p12 certificate.
19+
required: true
20+
MACOS_SIGNING_CERT_PASSWORD:
21+
description: Password for the .p12 certificate.
22+
required: true
23+
24+
outputs:
25+
CODESIGN_TEAM:
26+
description: The Team ID.
27+
value: ${{ steps.extract.outputs.CODESIGN_TEAM }}
28+
29+
runs:
30+
using: composite
31+
steps:
32+
- name: Extract Codesign Identity
33+
id: extract
34+
shell: bash --noprofile --norc -euo pipefail -O nullglob {0}
35+
env:
36+
MACOS_SIGNING_APPLICATION_IDENTITY: '${{ inputs.MACOS_SIGNING_APPLICATION_IDENTITY }}'
37+
run: |
38+
CODESIGN_TEAM="$(awk -F'[()]' '{ print $2 }' <<< "$MACOS_SIGNING_APPLICATION_IDENTITY")"
39+
40+
if [[ -z "$CODESIGN_TEAM" ]]; then
41+
echo "Error: Failed to extract Team ID from MACOS_SIGNING_APPLICATION_IDENTITY" >&2
42+
exit 1
43+
fi
44+
45+
printf 'CODESIGN_TEAM=%s\n' "$CODESIGN_TEAM" >> "$GITHUB_OUTPUT"
46+
47+
- name: Import Signing Certificate
48+
shell: bash --noprofile --norc -euo pipefail -O nullglob {0}
49+
env:
50+
MACOS_SIGNING_CERT: '${{ inputs.MACOS_SIGNING_CERT }}'
51+
MACOS_SIGNING_CERT_PASSWORD: '${{ inputs.MACOS_SIGNING_CERT_PASSWORD }}'
52+
run: |
53+
KEYCHAIN_DIR="$(mktemp -d -p "$RUNNER_TEMP" setup-macos-codesigning.XXXXXXXXXX)"
54+
KEYCHAIN_DB="$KEYCHAIN_DIR/app-signing.keychain-db"
55+
KEYCHAIN_PASSWORD="$(openssl rand -base64 32)"
56+
57+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_DB"
58+
security set-keychain-settings -lut 21600 "$KEYCHAIN_DB"
59+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_DB"
60+
61+
security default-keychain -s "$KEYCHAIN_DB"
62+
63+
base64 --decode <<< "$MACOS_SIGNING_CERT" > "$KEYCHAIN_DIR/certificate.p12"
64+
security import "$KEYCHAIN_DIR/certificate.p12" -k "$KEYCHAIN_DB" -P "$MACOS_SIGNING_CERT_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productbuild
65+
rm "$KEYCHAIN_DIR/certificate.p12"
66+
67+
security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_DB"

0 commit comments

Comments
 (0)