Skip to content

Commit 017d64d

Browse files
[ci] Run analysis with older versions of Flutter (#1152)
1 parent 1cc7cea commit 017d64d

File tree

26 files changed

+138
-97
lines changed

26 files changed

+138
-97
lines changed

.ci/scripts/prepare_tool.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ git fetch origin master
88

99
# Pinned version of the plugin tools, to avoid breakage in this repository
1010
# when pushing updates from flutter/plugins.
11-
dart pub global activate flutter_plugin_tools 0.7.3
11+
dart pub global activate flutter_plugin_tools 0.8.1

.cirrus.yml

+20-5
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
2929
- git fetch origin
3030
# Switch to the requested channel.
3131
- git checkout $TARGET_TREEISH
32-
# When using a branch rather than a hash, reset to the upstream branch
33-
# rather than using pull, since the base image can sometimes be in a state
34-
# where it has diverged from upstream (!).
35-
- if [[ "$TARGET_TREEISH" == "$CHANNEL" ]]; then
32+
# When using a branch rather than a hash or version tag, reset to the
33+
# upstream branch rather than using pull, since the base image can sometimes
34+
# be in a state where it has diverged from upstream (!).
35+
- if [[ "$TARGET_TREEISH" == "$CHANNEL" ]] && [[ "$CHANNEL" != *"."* ]]; then
3636
- git reset --hard @{u}
3737
- fi
3838
# Run doctor to allow auditing of what version of Flutter the run is using.
@@ -55,8 +55,23 @@ task:
5555
always:
5656
format_script: ./script/tool_runner.sh format --fail-on-change
5757
license_script: dart pub global run flutter_plugin_tools license-check
58-
analyze_script: ./script/tool_runner.sh analyze --custom-analysis=web_benchmarks/testing/test_app,flutter_lints/example,rfw/example,metrics_center
58+
analyze_script: ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml
5959
pubspec_script: ./script/tool_runner.sh pubspec-check
60+
# Does a sanity check that packages at least pass analysis on the N-1 and N-2
61+
# versions of Flutter stable if the package claims to support that version.
62+
# This is to minimize accidentally making changes that break old versions
63+
# (which we don't commit to supporting, but don't want to actively break)
64+
# without updating the constraints.
65+
# Note: The versions below should be manually updated after a new stable
66+
# version comes out.
67+
- name: legacy-version-analyze
68+
depends_on: format+analyze
69+
env:
70+
matrix:
71+
CHANNEL: "2.5.3"
72+
CHANNEL: "2.8.1"
73+
analyze_script:
74+
- ./script/tool_runner.sh analyze --skip-if-not-supporting-flutter-version="$CHANNEL" --custom-analysis=script/configs/custom_analysis.yaml
6075
- name: publishable
6176
env:
6277
# TODO(stuartmorgan): Remove once the fix for https://github.com/dart-lang/pub/issues/3152

.clang-format

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
BasedOnStyle: Google
2+
---
3+
Language: Cpp
4+
DerivePointerAlignment: false
5+
PointerAlignment: Left
6+
---
7+
Language: ObjC
8+
DerivePointerAlignment: false
9+
PointerAlignment: Right

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version.
3333
- name: Set up tools
34-
run: dart pub global activate flutter_plugin_tools 0.7.3
34+
run: dart pub global activate flutter_plugin_tools 0.8.1
3535

3636
# # This workflow should be the last to run. So wait for all the other tests to succeed.
3737
- name: Wait on all tests

packages/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/main.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#import <UIKit/UIKit.h>
77
#import "AppDelegate.h"
88

9-
int main(int argc, char* argv[]) {
9+
int main(int argc, char *argv[]) {
1010
@autoreleasepool {
1111
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
1212
}

packages/flutter_markdown/example/windows/runner/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "utils.h"
1212

1313
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
14-
_In_ wchar_t *command_line, _In_ int show_command) {
14+
_In_ wchar_t* command_line, _In_ int show_command) {
1515
// Attach to console when present (e.g., 'flutter run') or create a
1616
// new console when running with a debugger.
1717
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {

packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/SceneDelegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>
88

9-
@property(strong, nonatomic) UIWindow* window;
9+
@property(strong, nonatomic) UIWindow *window;
1010

1111
@end

packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ViewController.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
#import <UIKit/UIKit.h>
66

77
@interface ViewController : UIViewController
8-
@property(nonatomic, strong) IBOutlet UIImageView* imageView;
8+
@property(nonatomic, strong) IBOutlet UIImageView *imageView;
99

1010
@end

packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/main.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#import <UIKit/UIKit.h>
66
#import "AppDelegate.h"
77

8-
int main(int argc, char* argv[]) {
9-
NSString* appDelegateClassName;
8+
int main(int argc, char *argv[]) {
9+
NSString *appDelegateClassName;
1010
@autoreleasepool {
1111
// Setup code that might create autoreleased objects goes here.
1212
appDelegateClassName = NSStringFromClass([AppDelegate class]);

packages/palette_generator/example/ios/Runner/main.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#import <UIKit/UIKit.h>
77
#import "AppDelegate.h"
88

9-
int main(int argc, char* argv[]) {
9+
int main(int argc, char *argv[]) {
1010
@autoreleasepool {
1111
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
1212
}

packages/pigeon/e2e_tests/test_objc/ios/Runner/main.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#import <UIKit/UIKit.h>
77
#import "AppDelegate.h"
88

9-
int main(int argc, char* argv[]) {
9+
int main(int argc, char *argv[]) {
1010
@autoreleasepool {
1111
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
1212
}

packages/pigeon/platform_tests/ios_unit_tests/ios/Runner/main.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#import <UIKit/UIKit.h>
77
#import "AppDelegate.h"
88

9-
int main(int argc, char* argv[]) {
9+
int main(int argc, char *argv[]) {
1010
@autoreleasepool {
1111
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
1212
}

packages/pigeon/platform_tests/ios_unit_tests/ios/RunnerTests/AllDatatypesTest.m

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ @interface AllDatatypesTest : XCTestCase
1515
@implementation AllDatatypesTest
1616

1717
- (void)testAllNull {
18-
Everything* everything = [[Everything alloc] init];
19-
EchoBinaryMessenger* binaryMessenger =
18+
Everything *everything = [[Everything alloc] init];
19+
EchoBinaryMessenger *binaryMessenger =
2020
[[EchoBinaryMessenger alloc] initWithCodec:FlutterEverythingGetCodec()];
21-
FlutterEverything* api = [[FlutterEverything alloc] initWithBinaryMessenger:binaryMessenger];
22-
XCTestExpectation* expectation = [self expectationWithDescription:@"callback"];
21+
FlutterEverything *api = [[FlutterEverything alloc] initWithBinaryMessenger:binaryMessenger];
22+
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
2323
[api echoEverything:everything
24-
completion:^(Everything* _Nonnull result, NSError* _Nullable error) {
24+
completion:^(Everything *_Nonnull result, NSError *_Nullable error) {
2525
XCTAssertNil(result.aBool);
2626
XCTAssertNil(result.anInt);
2727
XCTAssertNil(result.aDouble);
@@ -38,7 +38,7 @@ - (void)testAllNull {
3838
}
3939

4040
- (void)testAllEquals {
41-
Everything* everything = [[Everything alloc] init];
41+
Everything *everything = [[Everything alloc] init];
4242
everything.aBool = @NO;
4343
everything.anInt = @(1);
4444
everything.aDouble = @(2.0);
@@ -54,12 +54,12 @@ - (void)testAllEquals {
5454
everything.aList = @[ @(1), @(2) ];
5555
everything.aMap = @{@"hello" : @(1234)};
5656
everything.mapWithObject = @{@"hello" : @(1234), @"goodbye" : @"world"};
57-
EchoBinaryMessenger* binaryMessenger =
57+
EchoBinaryMessenger *binaryMessenger =
5858
[[EchoBinaryMessenger alloc] initWithCodec:FlutterEverythingGetCodec()];
59-
FlutterEverything* api = [[FlutterEverything alloc] initWithBinaryMessenger:binaryMessenger];
60-
XCTestExpectation* expectation = [self expectationWithDescription:@"callback"];
59+
FlutterEverything *api = [[FlutterEverything alloc] initWithBinaryMessenger:binaryMessenger];
60+
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
6161
[api echoEverything:everything
62-
completion:^(Everything* _Nonnull result, NSError* _Nullable error) {
62+
completion:^(Everything *_Nonnull result, NSError *_Nullable error) {
6363
XCTAssertEqual(result.aBool, everything.aBool);
6464
XCTAssertEqual(result.anInt, everything.anInt);
6565
XCTAssertEqual(result.aDouble, everything.aDouble);

packages/pigeon/platform_tests/ios_unit_tests/ios/RunnerTests/EchoMessenger.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
1010
/// A FlutterBinaryMessenger who replies with the first argument sent to it.
1111
@interface EchoBinaryMessenger : NSObject <FlutterBinaryMessenger>
1212
- (instancetype)init NS_UNAVAILABLE;
13-
- (instancetype)initWithCodec:(NSObject<FlutterMessageCodec>*)codec;
13+
- (instancetype)initWithCodec:(NSObject<FlutterMessageCodec> *)codec;
1414
@end
1515

1616
NS_ASSUME_NONNULL_END

packages/pigeon/platform_tests/ios_unit_tests/ios/RunnerTests/EnumTest.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ @interface EnumTest : XCTestCase
1515
@implementation EnumTest
1616

1717
- (void)testEcho {
18-
ACData* data = [[ACData alloc] init];
18+
ACData *data = [[ACData alloc] init];
1919
data.state = ACStateError;
20-
EchoBinaryMessenger* binaryMessenger =
20+
EchoBinaryMessenger *binaryMessenger =
2121
[[EchoBinaryMessenger alloc] initWithCodec:ACEnumApi2HostGetCodec()];
22-
ACEnumApi2Flutter* api = [[ACEnumApi2Flutter alloc] initWithBinaryMessenger:binaryMessenger];
23-
XCTestExpectation* expectation = [self expectationWithDescription:@"callback"];
22+
ACEnumApi2Flutter *api = [[ACEnumApi2Flutter alloc] initWithBinaryMessenger:binaryMessenger];
23+
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
2424
[api echoData:data
25-
completion:^(ACData* _Nonnull result, NSError* _Nullable error) {
25+
completion:^(ACData *_Nonnull result, NSError *_Nullable error) {
2626
XCTAssertEqual(data.state, result.state);
2727
[expectation fulfill];
2828
}];

packages/pigeon/platform_tests/ios_unit_tests/ios/RunnerTests/ListTest.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ @interface ListTest : XCTestCase
1515
@implementation ListTest
1616

1717
- (void)testListInList {
18-
LSTTestMessage* top = [[LSTTestMessage alloc] init];
19-
LSTTestMessage* inside = [[LSTTestMessage alloc] init];
18+
LSTTestMessage *top = [[LSTTestMessage alloc] init];
19+
LSTTestMessage *inside = [[LSTTestMessage alloc] init];
2020
inside.testList = @[ @1, @2, @3 ];
2121
top.testList = @[ inside ];
22-
EchoBinaryMessenger* binaryMessenger =
22+
EchoBinaryMessenger *binaryMessenger =
2323
[[EchoBinaryMessenger alloc] initWithCodec:LSTEchoApiGetCodec()];
24-
LSTEchoApi* api = [[LSTEchoApi alloc] initWithBinaryMessenger:binaryMessenger];
25-
XCTestExpectation* expectation = [self expectationWithDescription:@"callback"];
24+
LSTEchoApi *api = [[LSTEchoApi alloc] initWithBinaryMessenger:binaryMessenger];
25+
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
2626
[api echoMsg:top
27-
completion:^(LSTTestMessage* _Nonnull result, NSError* _Nullable err) {
27+
completion:^(LSTTestMessage *_Nonnull result, NSError *_Nullable err) {
2828
XCTAssertEqual(1u, result.testList.count);
2929
XCTAssertTrue([result.testList[0] isKindOfClass:[LSTTestMessage class]]);
3030
XCTAssertEqualObjects(inside.testList, [result.testList[0] testList]);

packages/pigeon/platform_tests/ios_unit_tests/ios/RunnerTests/NonNullFieldsTest.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ @interface NonNullFieldsTest : XCTestCase
1616
@implementation NonNullFieldsTest
1717

1818
- (void)testMake {
19-
NNFSearchRequest* request = [NNFSearchRequest makeWithQuery:@"hello"];
19+
NNFSearchRequest *request = [NNFSearchRequest makeWithQuery:@"hello"];
2020
XCTAssertEqualObjects(@"hello", request.query);
2121
}
2222

packages/pigeon/platform_tests/ios_unit_tests/ios/RunnerTests/NullableReturnsTest.m

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
///////////////////////////////////////////////////////////////////////////////////////////
1111
@interface MockNullableArgHostApi : NSObject <NRNullableArgHostApi>
1212
@property(nonatomic, assign) BOOL didCall;
13-
@property(nonatomic, copy) NSNumber* x;
13+
@property(nonatomic, copy) NSNumber *x;
1414
@end
1515

1616
///////////////////////////////////////////////////////////////////////////////////////////
1717
@implementation MockNullableArgHostApi
18-
- (nullable NSNumber*)doitX:(NSNumber* _Nullable)x
19-
error:(FlutterError* _Nullable __autoreleasing* _Nonnull)error {
18+
- (nullable NSNumber *)doitX:(NSNumber *_Nullable)x
19+
error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error {
2020
_didCall = YES;
2121
self.x = x;
2222
return x;
@@ -32,29 +32,29 @@ @interface NullableReturnsTest : XCTestCase
3232
@implementation NullableReturnsTest
3333

3434
- (void)testNullableParameterWithFlutterApi {
35-
EchoBinaryMessenger* binaryMessenger =
35+
EchoBinaryMessenger *binaryMessenger =
3636
[[EchoBinaryMessenger alloc] initWithCodec:NRNullableArgFlutterApiGetCodec()];
37-
NRNullableArgFlutterApi* api =
37+
NRNullableArgFlutterApi *api =
3838
[[NRNullableArgFlutterApi alloc] initWithBinaryMessenger:binaryMessenger];
39-
XCTestExpectation* expectation = [self expectationWithDescription:@"callback"];
39+
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
4040
[api doitX:nil
41-
completion:^(NSNumber* _Nonnull result, NSError* _Nullable error) {
41+
completion:^(NSNumber *_Nonnull result, NSError *_Nullable error) {
4242
XCTAssertNil(result);
4343
[expectation fulfill];
4444
}];
4545
[self waitForExpectations:@[ expectation ] timeout:1.0];
4646
}
4747

4848
- (void)testNullableParameterWithHostApi {
49-
MockNullableArgHostApi* api = [[MockNullableArgHostApi alloc] init];
50-
MockBinaryMessenger* binaryMessenger =
49+
MockNullableArgHostApi *api = [[MockNullableArgHostApi alloc] init];
50+
MockBinaryMessenger *binaryMessenger =
5151
[[MockBinaryMessenger alloc] initWithCodec:NRNullableArgHostApiGetCodec()];
52-
NSString* channel = @"dev.flutter.pigeon.NullableArgHostApi.doit";
52+
NSString *channel = @"dev.flutter.pigeon.NullableArgHostApi.doit";
5353
NRNullableArgHostApiSetup(binaryMessenger, api);
5454
XCTAssertNotNil(binaryMessenger.handlers[channel]);
55-
XCTestExpectation* expectation = [self expectationWithDescription:@"callback"];
56-
NSData* arguments = [NRNullableArgHostApiGetCodec() encode:@[ [NSNull null] ]];
57-
binaryMessenger.handlers[channel](arguments, ^(NSData* data) {
55+
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
56+
NSData *arguments = [NRNullableArgHostApiGetCodec() encode:@[ [NSNull null] ]];
57+
binaryMessenger.handlers[channel](arguments, ^(NSData *data) {
5858
[expectation fulfill];
5959
});
6060
XCTAssertTrue(api.didCall);

0 commit comments

Comments
 (0)