From 499e6398b1bdc0ea2b918057ae1e77d616fd444b Mon Sep 17 00:00:00 2001 From: Fabio Milano Date: Tue, 8 Jan 2019 09:43:06 -0800 Subject: [PATCH] [CK][Linter Rule] Add CKRenderLayoutWithChildren component to Component Kit Conventional Superclass Reviewed By: kfirapps, ddino Differential Revision: D13590184 fbshipit-source-id: d4394839e --- 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 36f905fcd..2bd0e68ea 100644 --- a/infer/src/clang/ComponentKit.ml +++ b/infer/src/clang/ComponentKit.ml @@ -228,6 +228,7 @@ let component_with_unconventional_superclass_advice context an = ; "CKCompositeComponent" ; "CKRenderComponent" ; "CKRenderLayoutComponent" + ; "CKRenderLayoutWithChildrenComponent" ; "CKRenderWithChildrenComponent" ; "CKStatefulViewComponent" ; "CKStatefulViewComponentController" diff --git a/infer/tests/codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h b/infer/tests/codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h index 2fb96cf33..704fa8d9f 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h +++ b/infer/tests/codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h @@ -70,3 +70,7 @@ class CKComponentScope { // Mimic importing CKRenderLayoutComponent @interface CKRenderLayoutComponent : CKComponent @end + +// Mimic importing CKRenderLayoutWithChildrenComponent +@interface CKRenderLayoutWithChildrenComponent : CKComponent +@end diff --git a/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.h b/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.h index 23b80ab56..405d5f914 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.h +++ b/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.h @@ -29,3 +29,6 @@ @interface RenderLayoutFooComponent : CKRenderLayoutComponent // good @end + +@interface RenderLayoutWithChildrenFooComponent : CKRenderLayoutWithChildrenComponent // good +@end diff --git a/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.mm b/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.mm index 2e84413ec..9ba6c2590 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.mm +++ b/infer/tests/codetoanalyze/objcpp/linters/componentkit/UnconventionalSuperclassTest.mm @@ -26,3 +26,6 @@ @implementation RenderLayoutFooComponent @end + +@implementation RenderLayoutWithChildrenFooComponent +@end