Skip to content

Commit c8d92af

Browse files
maciejmakowski2003maciejmakowski2003
andauthored
chore: linting configuration adjustments (#798)
* chore: linting configuration adjustments * refactor: set AlignTrailingComments to true --------- Co-authored-by: maciejmakowski2003 <maciej.makowski2608@gmail.com>
1 parent 7f69eb8 commit c8d92af

22 files changed

+571
-358
lines changed
Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,33 @@
11
---
2+
ColumnLimit: 80
23
AccessModifierOffset: -1
34
AlignAfterOpenBracket: AlwaysBreak
45
AlignConsecutiveAssignments: false
56
AlignConsecutiveDeclarations: false
6-
AlignEscapedNewlinesLeft: true
7+
AlignEscapedNewlines: DontAlign
78
AlignOperands: false
8-
AlignTrailingComments: false
9+
AlignTrailingComments: true
910
AllowAllParametersOfDeclarationOnNextLine: false
10-
AllowShortBlocksOnASingleLine: false
11+
AllowShortBlocksOnASingleLine: Empty
1112
AllowShortCaseLabelsOnASingleLine: false
13+
AllowShortCompoundRequirementOnASingleLine: true
14+
AllowShortEnumsOnASingleLine: true
1215
AllowShortFunctionsOnASingleLine: Empty
13-
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortIfStatementsOnASingleLine: Never
17+
AllowShortLambdasOnASingleLine: Inline
1418
AllowShortLoopsOnASingleLine: false
15-
AlwaysBreakAfterReturnType: None
1619
AlwaysBreakBeforeMultilineStrings: true
1720
AlwaysBreakTemplateDeclarations: true
1821
BinPackArguments: false
1922
BinPackParameters: false
20-
BraceWrapping:
21-
AfterClass: false
22-
AfterControlStatement: false
23-
AfterEnum: false
24-
AfterFunction: false
25-
AfterNamespace: false
26-
AfterObjCDeclaration: false
27-
AfterStruct: false
28-
AfterUnion: false
29-
BeforeCatch: false
30-
BeforeElse: false
31-
IndentBraces: false
3223
BreakBeforeBinaryOperators: None
3324
BreakBeforeBraces: Attach
3425
BreakBeforeTernaryOperators: true
35-
BreakConstructorInitializersBeforeComma: false
26+
BreakConstructorInitializers: BeforeColon
3627
BreakAfterJavaFieldAnnotations: false
3728
BreakStringLiterals: false
38-
ColumnLimit: 80
3929
CommentPragmas: '^ IWYU pragma:'
40-
ConstructorInitializerAllOnOneLineOrOnePerLine: true
30+
PackConstructorInitializers: NextLine
4131
ConstructorInitializerIndentWidth: 4
4232
ContinuationIndentWidth: 4
4333
Cpp11BracedListStyle: true
@@ -54,37 +44,36 @@ IncludeCategories:
5444
IndentCaseLabels: true
5545
IndentWidth: 2
5646
IndentWrappedFunctionNames: false
57-
KeepEmptyLinesAtTheStartOfBlocks: false
5847
MacroBlockBegin: ''
5948
MacroBlockEnd: ''
6049
MaxEmptyLinesToKeep: 1
6150
NamespaceIndentation: None
62-
ObjCBlockIndentWidth: 2
63-
ObjCSpaceAfterProperty: true
64-
ObjCSpaceBeforeProtocolList: true
6551
PenaltyBreakBeforeFirstCallParameter: 1
6652
PenaltyBreakComment: 300
6753
PenaltyBreakFirstLessLess: 120
6854
PenaltyBreakString: 1000
6955
PenaltyExcessCharacter: 1000000
7056
PenaltyReturnTypeOnItsOwnLine: 200
7157
PointerAlignment: Right
72-
ReflowComments: true
58+
ReflowComments: false
59+
RequiresExpressionIndentation: OuterScope
7360
SortIncludes: true
7461
SpaceAfterCStyleCast: false
7562
SpaceBeforeAssignmentOperators: true
7663
SpaceBeforeParens: ControlStatements
7764
SpaceInEmptyParentheses: false
7865
SpacesBeforeTrailingComments: 1
79-
SpacesInAngles: false
66+
SpacesInAngles: Never
8067
SpacesInContainerLiterals: true
8168
SpacesInCStyleCastParentheses: false
82-
SpacesInParentheses: false
8369
SpacesInSquareBrackets: false
84-
Standard: Cpp11
85-
TabWidth: 2
8670
UseTab: Never
8771
---
72+
Language: Cpp
73+
Standard: c++20
74+
---
8875
Language: ObjC
89-
ColumnLimit: 120
9076
BreakBeforeBraces: WebKit
77+
ObjCBlockIndentWidth: 2
78+
ObjCSpaceAfterProperty: true
79+
ObjCSpaceBeforeProtocolList: true

packages/react-native-audio-api/common/cpp/audioapi/HostObjects/AudioContextHostObject.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ JSI_HOST_FUNCTION_IMPL(AudioContextHostObject, resume) {
3333
auto promise = promiseVendor_->createAsyncPromise(
3434
[audioContext = std::move(audioContext)]() {
3535
auto result = audioContext->resume();
36-
return [result](jsi::Runtime &runtime) { return jsi::Value(result); };
36+
return [result](jsi::Runtime &runtime) {
37+
return jsi::Value(result);
38+
};
3739
});
3840
return promise;
3941
}
@@ -43,7 +45,9 @@ JSI_HOST_FUNCTION_IMPL(AudioContextHostObject, suspend) {
4345
auto promise = promiseVendor_->createAsyncPromise(
4446
[audioContext = std::move(audioContext)]() {
4547
auto result = audioContext->suspend();
46-
return [result](jsi::Runtime &runtime) { return jsi::Value(result); };
48+
return [result](jsi::Runtime &runtime) {
49+
return jsi::Value(result);
50+
};
4751
});
4852

4953
return promise;

packages/react-native-audio-api/common/cpp/audioapi/HostObjects/OfflineAudioContextHostObject.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ JSI_HOST_FUNCTION_IMPL(OfflineAudioContextHostObject, resume) {
2020
auto audioContext = std::static_pointer_cast<OfflineAudioContext>(context_);
2121
auto promise = promiseVendor_->createAsyncPromise([audioContext]() {
2222
audioContext->resume();
23-
return [](jsi::Runtime &runtime) { return jsi::Value::undefined(); };
23+
return [](jsi::Runtime &runtime) {
24+
return jsi::Value::undefined();
25+
};
2426
});
2527

2628
return promise;

packages/react-native-audio-api/common/cpp/audioapi/dsp/VectorMath.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -508,15 +508,15 @@ void multiply(
508508
bool source2Aligned = is16ByteAligned(inputVector2);
509509
bool destAligned = is16ByteAligned(outputVector);
510510

511-
#define SSE2_MULT(loadInstr, storeInstr) \
512-
while (outputVector < endP) { \
513-
pSource1 = _mm_load_ps(inputVector1); \
511+
#define SSE2_MULT(loadInstr, storeInstr) \
512+
while (outputVector < endP) { \
513+
pSource1 = _mm_load_ps(inputVector1); \
514514
pSource2 = _mm_##loadInstr##_ps(inputVector2); \
515-
dest = _mm_mul_ps(pSource1, pSource2); \
516-
_mm_##storeInstr##_ps(outputVector, dest); \
517-
inputVector1 += 4; \
518-
inputVector2 += 4; \
519-
outputVector += 4; \
515+
dest = _mm_mul_ps(pSource1, pSource2); \
516+
_mm_##storeInstr##_ps(outputVector, dest); \
517+
inputVector1 += 4; \
518+
inputVector2 += 4; \
519+
outputVector += 4; \
520520
}
521521

522522
if (source2Aligned && destAligned) // Both aligned.
@@ -647,15 +647,15 @@ void multiplyByScalarThenAddToOutput(
647647

648648
bool destAligned = is16ByteAligned(outputVector);
649649

650-
#define SSE2_MULT_ADD(loadInstr, storeInstr) \
651-
while (outputVector < endP) { \
652-
pSource = _mm_load_ps(inputVector); \
653-
temp = _mm_mul_ps(pSource, mScale); \
650+
#define SSE2_MULT_ADD(loadInstr, storeInstr) \
651+
while (outputVector < endP) { \
652+
pSource = _mm_load_ps(inputVector); \
653+
temp = _mm_mul_ps(pSource, mScale); \
654654
dest = _mm_##loadInstr##_ps(outputVector); \
655-
dest = _mm_add_ps(dest, temp); \
655+
dest = _mm_add_ps(dest, temp); \
656656
_mm_##storeInstr##_ps(outputVector, dest); \
657-
inputVector += 4; \
658-
outputVector += 4; \
657+
inputVector += 4; \
658+
outputVector += 4; \
659659
}
660660

661661
if (destAligned)

packages/react-native-audio-api/common/cpp/test/src/biquad/BiquadFilterTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,18 @@ INSTANTIATE_TEST_SUITE_P(
8989
Frequencies,
9090
BiquadFilterFrequencyTest,
9191
::testing::Values(
92-
0.0f, // 0 Hz - the filter should block all input signal
93-
10.0f, // very low frequency
92+
0.0f, // 0 Hz - the filter should block all input signal
93+
10.0f, // very low frequency
9494
350.0f, // default
9595
nyquistFrequency - 0.0001f, // frequency near Nyquist
96-
nyquistFrequency)); // maximal frequency
96+
nyquistFrequency)); // maximal frequency
9797

9898
INSTANTIATE_TEST_SUITE_P(
9999
QEdgeCases,
100100
BiquadFilterQTestLowpassHighpass,
101101
::testing::Values(
102-
-770.63678f, // min value for lowpass and highpass
103-
0.0f, // default
102+
-770.63678f, // min value for lowpass and highpass
103+
0.0f, // default
104104
770.63678f)); // max value for lowpass and highpass
105105

106106
INSTANTIATE_TEST_SUITE_P(

packages/react-native-audio-api/ios/audioapi/ios/AudioAPIModule.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,20 @@
1313
@class AudioSessionManager;
1414
@class LockScreenManager;
1515

16-
@interface AudioAPIModule : RCTEventEmitter
16+
@interface AudioAPIModule
17+
: RCTEventEmitter
1718
#ifdef RCT_NEW_ARCH_ENABLED
18-
<NativeAudioAPIModuleSpec, RCTCallInvokerModule, RCTInvalidating>
19+
<NativeAudioAPIModuleSpec, RCTCallInvokerModule, RCTInvalidating>
1920
#else
20-
<RCTBridgeModule>
21+
<RCTBridgeModule>
2122
#endif // RCT_NEW_ARCH_ENABLED
2223

2324
@property (nonatomic, strong) AudioEngine *audioEngine;
2425
@property (nonatomic, strong) NotificationManager *notificationManager;
2526
@property (nonatomic, strong) AudioSessionManager *audioSessionManager;
2627
@property (nonatomic, strong) LockScreenManager *lockScreenManager;
2728

28-
- (void)invokeHandlerWithEventName:(NSString *)eventName eventBody:(NSDictionary *)eventBody;
29+
- (void)invokeHandlerWithEventName:(NSString *)eventName
30+
eventBody:(NSDictionary *)eventBody;
2931

3032
@end

0 commit comments

Comments
 (0)