Skip to content

Fix @IBInspectable unused declarations with get/set - #3458

Merged
keith merged 2 commits into
masterfrom
ks/fix-ibinspectable-unused-declarations-with-get-set
Dec 7, 2020
Merged

keith merged 2 commits into
masterfrom
ks/fix-ibinspectable-unused-declarations-with-get-set

Conversation

@keith

@keith keith commented Dec 7, 2020

Copy link
Copy Markdown
Contributor

This fixes an issue where @IBInspectables that have both a custom
getter and setter were marked as dead if they weren't referenced in code
even though in that case they can still have behavior if they are used
from IB.

@keith
keith marked this pull request as ready for review December 7, 2020 18:11
@jpsim

jpsim commented Dec 7, 2020

Copy link
Copy Markdown
Collaborator

Fix looks good, thank you! Can you remove the changelog entry you added since the bug didn't ship in a production release? I'm still trying to come up with a good process for having pre-release versions, sorry for the confusion.

@keith
keith force-pushed the ks/fix-ibinspectable-unused-declarations-with-get-set branch from 255a87c to 5afeea9 Compare December 7, 2020 18:20
@SwiftLintBot

SwiftLintBot commented Dec 7, 2020 •

Copy link
Copy Markdown
1 Warning
⚠️ Please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
12 Messages
📖 Linting Aerial with this PR took 1.95s vs 1.96s on master (0% faster)
📖 Linting Alamofire with this PR took 2.83s vs 2.83s on master (0% slower)
📖 Linting Firefox with this PR took 9.38s vs 9.39s on master (0% faster)
📖 Linting Kickstarter with this PR took 15.35s vs 15.4s on master (0% faster)
📖 Linting Moya with this PR took 1.49s vs 1.44s on master (3% slower)
📖 Linting Nimble with this PR took 1.32s vs 1.33s on master (0% faster)
📖 Linting Quick with this PR took 0.6s vs 0.61s on master (1% faster)
📖 Linting Realm with this PR took 4.35s vs 4.4s on master (1% faster)
📖 Linting SourceKitten with this PR took 1.03s vs 1.04s on master (0% faster)
📖 Linting Sourcery with this PR took 7.66s vs 7.62s on master (0% slower)
📖 Linting Swift with this PR took 11.13s vs 11.13s on master (0% slower)
📖 Linting WordPress with this PR took 17.22s vs 17.24s on master (0% faster)

Here's an example of your CHANGELOG entry:

* Fix @IBInspectable unused declarations with get/set.  
  [keith](https://github.com/keith)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

This fixes an issue where `@IBInspectables` that have both a custom
getter and setter were marked as dead if they weren't referenced in code
even though in that case they can still have behavior if they are used
from IB.
@keith
keith force-pushed the ks/fix-ibinspectable-unused-declarations-with-get-set branch from 5afeea9 to fd86b0f Compare December 7, 2020 18:21
@keith

keith commented Dec 7, 2020

Copy link
Copy Markdown
Contributor Author

Np, done

@jpsim

jpsim commented Dec 7, 2020

Copy link
Copy Markdown
Collaborator

CI is failing because the declaredUSR(...) spans too many lines, and in this case I think it's worth splitting up rather than silencing the violation.

@keith

keith commented Dec 7, 2020

Copy link
Copy Markdown
Contributor Author

Broke out the 2 statements about ignoring the current entity, happy to do something more if you have something in mind, it's a nice improvement IMO but not much

@jpsim

jpsim commented Dec 7, 2020

Copy link
Copy Markdown
Collaborator

Perfect.

@keith
keith merged commit 22ee449 into master Dec 7, 2020
@keith
keith deleted the ks/fix-ibinspectable-unused-declarations-with-get-set branch December 7, 2020 19:07
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.

3 participants