IBDecodable / IBLinter

A linter tool for Interface Builder
MIT License
950 stars 40 forks source link

Randomly fails when the same name classes exists in two modules #113

Closed sidepelican closed 4 years ago

sidepelican commented 4 years ago

Example

ModuleA
  - XXXView 
  - YYYView
ModuleB
  - XXXView
  - ZZZView

In this case, IBLinter fails randomly with this message. - [ ] aaa/bbb/ccc/AwesomeView.xib#L0: It does not match custom module rule in AwesomeView. Custom module of XXXView is ModuleB

Maybe this is caused by ↓

https://github.com/IBDecodable/IBLinter/blob/0bcc377d427faa21b2ebcea5d83acefecefc521c/Sources/IBLinterKit/Rules/CustomModuleRule.swift#L87

it selects target module with first in Dictionary

kateinoigakukun commented 4 years ago

@sidepelican Could you try this branch? https://github.com/IBDecodable/IBLinter/pull/114

sidepelican commented 4 years ago

@kateinoigakukun Thank you the fast implementation.

I tried in my project and it wasn't fine. But I cannot analyze failing reason because of confused error message ( https://github.com/IBDecodable/IBLinter/pull/114#discussion_r326033539 ). Please fix it first 🙏 ?

sidepelican commented 4 years ago

https://github.com/IBDecodable/IBLinter/pull/114#issuecomment-533154652