IBDecodable / IBLinter

A linter tool for Interface Builder
MIT License
949 stars 42 forks source link

Adds rules to keep "View as" device #86

Closed shosokawa closed 5 years ago

shosokawa commented 5 years ago

This PR is to add rules to keep "View as" device for files as specific one. "View as" is useful to confirm that constraints are working correctly on any types of devices. But sometimes we got unnecessary difference for .storyboard unexpectedly when it is left as changed from previous commit. This unexpected difference makes management of .storyboard files more complex. So I consider that it is useful to keep "View as" device at least on commits.

kateinoigakukun commented 5 years ago

Thanks for your contribution! It looks almost good 👍 I'm a little worried about these view_as_* rule can be enabled at same time. How about specifying the device like use_base_class_rule ? And considering for adding new device, I think it's better to represent DeviceId as String instead of enum. https://github.com/IBDecodable/IBLinter#usebaseclassconfig

shosokawa commented 5 years ago

I overlooked that it's possible to configure rules like that. I will change to use configuration.

And considering for adding new device, I think it's better to represent DeviceId as String instead of enum

I agree that. In case of current implementation that has no configuration, it wasn't necessary to consider about passing deviceId from outside. But for next, it's better to avoid restriction for flexibility.

shosokawa commented 5 years ago

I updated code as it can specify device_id by configuration.

shosokawa commented 5 years ago

I agree your suggestions completely. So I am ok to commit your "Suggested change" by tapping the button. On this project, commits are squashed automatically when it is merged? Should I squash commits?

kateinoigakukun commented 5 years ago

OK, I squash these commits when I merge this PR 👍.