cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
52 lines
1.5 KiB
Objective-C
52 lines
1.5 KiB
Objective-C
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
|
|
|
@interface X1
|
|
@end
|
|
@implementation X1 // expected-note {{implementation started here}}
|
|
@interface Y1 // expected-error {{missing '@end'}}
|
|
@end
|
|
@end // expected-error {{'@end' must appear in an Objective-C context}}
|
|
|
|
@interface X2
|
|
@end
|
|
@implementation X2 // expected-note {{implementation started here}}
|
|
@protocol Y2 // expected-error {{missing '@end'}}
|
|
@end
|
|
@end // expected-error {{'@end' must appear in an Objective-C context}}
|
|
|
|
@interface X6 // expected-note {{class started here}}
|
|
@interface X7 // expected-error {{missing '@end'}}
|
|
@end
|
|
@end // expected-error {{'@end' must appear in an Objective-C context}}
|
|
|
|
@protocol P1 // expected-note {{protocol started here}}
|
|
@interface P2 // expected-error {{missing '@end'}}
|
|
@end
|
|
@end // expected-error {{'@end' must appear in an Objective-C context}}
|
|
|
|
@interface X4 // expected-note {{class started here}}
|
|
@implementation X4 // expected-error {{missing '@end'}}
|
|
@end
|
|
@end // expected-error {{'@end' must appear in an Objective-C context}}
|
|
|
|
@interface I
|
|
@end
|
|
@implementation I
|
|
@protocol P; // forward declarations of protocols in @implementations is allowed
|
|
@class C; // forward declarations of classes in @implementations is allowed
|
|
- (C<P>*) MyMeth {}
|
|
@end
|
|
|
|
@interface I2 {} // expected-note {{class started here}}
|
|
@protocol P2; // expected-error {{missing '@end'}}
|
|
@class C2;
|
|
@end // expected-error {{'@end' must appear in an Objective-C context}}
|
|
|
|
@interface I3
|
|
@end
|
|
@implementation I3
|
|
- Meth {}
|
|
+ Cls {}
|
|
@protocol P3;
|
|
@end
|