From 28c3ed50de9cf922fe13defd40385a00e7e5dd1c Mon Sep 17 00:00:00 2001 From: Fabio Milano Date: Tue, 8 Jan 2019 09:40:39 -0800 Subject: [PATCH] [CK][Linter Rule] Add CKRenderLayout component to Component Kit Conventional Superclass Reviewed By: kfirapps, ddino Differential Revision: D13590155 fbshipit-source-id: 1a9f4ba15 --- infer/src/clang/ComponentKit.ml | 1 + .../objcpp/linters/componentkit/FakeComponentKitHeader.h | 4 ++++ .../linters/componentkit/UnconventionalSuperclassTest.h | 3 +++ .../linters/componentkit/UnconventionalSuperclassTest.mm | 3 +++ 4 files changed, 11 insertions(+) diff --git a/infer/src/clang/ComponentKit.ml b/infer/src/clang/ComponentKit.ml index d9c89da40..36f905fcd 100644 --- a/infer/src/clang/ComponentKit.ml +++ b/infer/src/clang/ComponentKit.ml @@ -227,6 +227,7 @@ let component_with_unconventional_superclass_advice context an = ; ckcomponentcontroller_cl ; "CKCompositeComponent" ; "CKRenderComponent" + ; "CKRenderLayoutComponent" ; "CKRenderWithChildrenComponent" ; "CKStatefulViewComponent" ; "CKStatefulViewComponentController" diff --git a/infer/tests/codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h b/infer/tests/codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h index 60f49e946..2fb96cf33 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h +++ b/infer/tests/codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h @@ -66,3 +66,7 @@ class CKComponentScope { // Mimic importing CKRenderWithChildrenComponent @interface CKRenderWithChildrenComponent : CKComponent @end + +// Mimic importing CKRenderLayoutComponent +@interface CKRenderLayoutComponent : CKComponent +@end diff --git a/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.h b/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.h index 84d9c9004..23b80ab56 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.h +++ b/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.h @@ -26,3 +26,6 @@ @interface RenderWithChildrenFooComponent : CKRenderWithChildrenComponent // good @end + +@interface RenderLayoutFooComponent : CKRenderLayoutComponent // good +@end diff --git a/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.mm b/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.mm index 4819245ee..2e84413ec 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.mm +++ b/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.mm @@ -23,3 +23,6 @@ @implementation RenderWithChildrenFooComponent @end + +@implementation RenderLayoutFooComponent +@end