Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check all candidates of module which matches class name. #114

Merged
merged 6 commits into from
Sep 19, 2019

Conversation

kateinoigakukun
Copy link
Collaborator

@kateinoigakukun kateinoigakukun commented Sep 19, 2019

Fix #113

@kateinoigakukun kateinoigakukun force-pushed the fix/custom_module/same-name-class-name branch from 2797fc3 to cbe00fe Compare September 19, 2019 05:13
let moduleCandidates = moduleClasses.lazy.filter({ $0.value.contains(customClass) }).map { $0.key }
guard !moduleCandidates.isEmpty else { return [] }
guard let customModule = classableObject.customModule, moduleCandidates.contains(customModule) else {
let message = "It does not match custom module rule in \(fileNameWithoutExtension). Custom module of \(customClass) is one of \(moduleCandidates)"
Copy link

@sidepelican sidepelican Sep 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\(moduleCandidates)

this outputs like this

LazyMapSequence<LazyFilterSequence<Dictionary<String, Array<String>>>, String>(_base: Swift.LazyFilterSequence<Swift.Dictionary<Swift.String, Swift.Array<Swift.String>>>(_base: ["ModuleA": ["AView", "BView", "CView",..... (a lot of classes)

I expect module names list.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the message format.

@kateinoigakukun kateinoigakukun force-pushed the fix/custom_module/same-name-class-name branch from edffe8d to e1c6599 Compare September 19, 2019 11:51
@sidepelican
Copy link

LGTM! It works. Thank you!

(After this implementation, it found that our project has another misuse of .xib 😅)

@kateinoigakukun kateinoigakukun merged commit 1adc890 into master Sep 19, 2019
@kateinoigakukun kateinoigakukun deleted the fix/custom_module/same-name-class-name branch September 19, 2019 14:39
@giginet
Copy link
Member

giginet commented Sep 19, 2019

@sidepelican Aren't you interested to be committer? 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Randomly fails when the same name classes exists in two modules
3 participants