Closed wata closed 3 years ago
I launch the DuplicateIDRuleTests
and no issue for me
(Xcode 12.4)
Thanks for checking. It's still a failure for me (Xcode 12.5)
I’m having same issue and get same result as https://github.com/IBDecodable/IBLinter/issues/170#issuecomment-839429672
Sorry for my slow response 🙇 Hmm, I couldn't reproduce the test failure in my local environment (w/Xcode12.5).
@wata Could you share your storyboard file facing this issue?
I test again, Xcode 12.5, IBDecodable version to 0.4.0 or 0.4.2 and no issue
Thanks for your response. This is the actual file. SignIn.storyboard.zip
@wata Thank you! However I couldn't reproduce the incorrect warning... 😢
What I tried is below. I tried this for master revision and the latest distributed version.
$ ls -a
.iblinter.yml
SignIn.storyboard
$ cat .iblinter.yml
enabled_rules:
- misplaced
- view_as_device
- image_resources
excluded:
- Pods
view_as_device_rule:
device_id: retina5_9
$ iblinter version
0.4.26
$ iblinter
/private/var/folders/br/7sr_p7cj7v549x_gtkb33df00000gp/T/tmp.ImklW2ND/SignIn.storyboard:0:0: error: appIcon_blue not found
My result:
$ ls -a
.iblinter.yml
SignIn.storyboard
$ cat .iblinter.yml
enabled_rules:
- misplaced
- view_as_device
- image_resources
excluded:
- Pods
view_as_device_rule:
device_id: retina5_9
$ iblinter version
0.4.26
$ iblinter
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id iYo-8I-qsd
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 7jp-cj-Jfa
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id E8n-kU-Q5C
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id L4O-JP-FdO
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Pnf-U7-Bf2
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id h6f-C9-KfF
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id nLy-az-dV5
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id oWg-9E-n1j
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id vQt-en-xID
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Nua-db-AEm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id JQk-rB-6c4
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id ugH-V1-KiJ
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id DBz-aR-sRp
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id OJa-3Q-x62
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 4qb-fh-kEd
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id vUP-Il-T7s
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id IfF-Ux-ccf
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id aUY-ad-dXj
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id L3f-4j-PFL
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 8fl-6F-IT8
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 8tB-gl-Bzn
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id TtQ-0E-1RQ
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Y9A-8a-Q6E
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id cnK-2q-oAm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id gxV-NN-gNj
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 9SU-qi-UFm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 94x-Bh-O82
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id iYo-8I-qsd
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 7jp-cj-Jfa
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id E8n-kU-Q5C
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id L4O-JP-FdO
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Pnf-U7-Bf2
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id h6f-C9-KfF
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id nLy-az-dV5
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id oWg-9E-n1j
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id vQt-en-xID
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Nua-db-AEm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id JQk-rB-6c4
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id ugH-V1-KiJ
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id DBz-aR-sRp
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id OJa-3Q-x62
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 4qb-fh-kEd
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id vUP-Il-T7s
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id IfF-Ux-ccf
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id aUY-ad-dXj
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id L3f-4j-PFL
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 8fl-6F-IT8
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 8tB-gl-Bzn
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id TtQ-0E-1RQ
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Y9A-8a-Q6E
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id cnK-2q-oAm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id gxV-NN-gNj
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 9SU-qi-UFm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id ar7-62-iKJ
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id iYo-8I-qsd
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 7jp-cj-Jfa
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id E8n-kU-Q5C
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id L4O-JP-FdO
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Pnf-U7-Bf2
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id h6f-C9-KfF
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id nLy-az-dV5
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id oWg-9E-n1j
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id vQt-en-xID
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Nua-db-AEm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id JQk-rB-6c4
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id ugH-V1-KiJ
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id DBz-aR-sRp
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id OJa-3Q-x62
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 4qb-fh-kEd
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id vUP-Il-T7s
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id IfF-Ux-ccf
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id aUY-ad-dXj
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id L3f-4j-PFL
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 8fl-6F-IT8
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 8tB-gl-Bzn
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id TtQ-0E-1RQ
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id Y9A-8a-Q6E
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id cnK-2q-oAm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id gxV-NN-gNj
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id 9SU-qi-UFm
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: warning: duplicate element id retina5_9
/Users/wata/tmp/2021-05-24/SignIn.storyboard:0:0: error: appIcon_blue not found
@wata OK, I could reproduce this problem with Docker. (yeah, but it's not still reproduced on my macOS 😅 )
I'll investigate this more. Thanks for your report!
FROM swift:5.4.0
WORKDIR /Workspace
RUN git clone https://github.com/IBDecodable/IBLinter.git .
RUN swift build
RUN swift test
BTW could you tell me your OS version? In different versions of macOS, Swift uses different runtime, so it may be related. My macOS is 11.2.3 (20D91).
Thank you for investigating. My macOS is 11.3 (20E232).
I got the reason for this problem.
Swift 5.4 has a new dynamic-cast implementation rewritten from 5.3's one. This re-implementation includes refactoring and bug fixes, so there are some different behavior from 5.3. The difference is described in here
According to the document, SR-1999 is fixed from Swift 5.4.
And the new implementation is shipped as a part of the Swift runtime library in macOS11.3.
SR-1999: Cannot cast Any contents to a protocol type
protocol P {} class Foo: P {} let optionalFoo: Foo? = Foo() let any: Any = optionalFoo // Swift 5.3: Prints "false" // Specification: prints "true" print(any as? P)
We have a part that depends on the incorrect cast behavior of SR-1999 in Swift 5.3. https://github.com/IBDecodable/IBDecodable/blob/4cce9b9e864ee924be62d45b6d971218c90bba52/Sources/IBProtocol.swift#L239-L250
Even compiling the code with Swift 5.3 compiler, the new cast implementation reveals our wrong implementation on macOS11.3 because Swift uses the runtime library of not compiler-toolchain's one but the running OS's one.
This is why I couldn't reproduce this issue on macOS 11.2.3, and your macOS 11.3 reveals this.
I'll fix this issue this week.
well done
PR on IBDecodable merged
IBlinter says
SignIn.storyboard:0:0: warning: duplicate element id 9SU-qi-UFm
. But in fact, there is only one element whose id is9SU-qi-UFm
. Is this the expected behavior?Version: 0.4.26 Using: Homebrew and CocoaPods - same result for both .iblinter.yml:
Search Results for
9SU-qi-UFm
:<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" usesAttributedText="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9SU-qi-UFm">
<constraint firstItem="9SU-qi-UFm" firstAttribute="leading" secondItem="L3f-4j-PFL" secondAttribute="leading" id="TtQ-0E-1RQ"/>
<constraint firstItem="9SU-qi-UFm" firstAttribute="centerX" secondItem="L3f-4j-PFL" secondAttribute="centerX" id="Y9A-8a-Q6E"/>
<constraint firstItem="9SU-qi-UFm" firstAttribute="centerY" secondItem="L3f-4j-PFL" secondAttribute="centerY" id="cnK-2q-oAm"/>
<constraint firstAttribute="trailing" secondItem="9SU-qi-UFm" secondAttribute="trailing" id="gxV-NN-gNj"/>
<outlet property="descriptionsTextView" destination="9SU-qi-UFm" id="ar7-62-iKJ"/>
I have tried DuplicateIDRuleTests with the latest version of the source code, but it seems to be failing.