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

Make redundant_discardable_let and unused_optional_binding opt-in #1446

Closed
klaaspieter opened this issue Apr 19, 2017 · 3 comments
Closed

Make redundant_discardable_let and unused_optional_binding opt-in #1446

klaaspieter opened this issue Apr 19, 2017 · 3 comments
Labels
discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions. wontfix Issues that became stale and were auto-closed by a bot.

Comments

@klaaspieter
Copy link

I believe code should be as easy possible to change. I think redundant_discardable_let and unused_optional_binding make code harder to change. Because of this I would prefer them to be opt-in rules.

They make code harder to change because with redundant_discardable_let the let has to be prepended again when the requirements change such that the value does have to be captured.

The unused_optional_binding is even harder because the code has to change from a trailing != nil to a leading let name =.

These rules are debated in the community and I think they should therefore be an opt-in rule

@marcelofabri marcelofabri added the discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions. label Apr 19, 2017
@freak4pc
Copy link
Contributor

+1 on this. Attaching the original Unused Optional Binding discussion with @jpsim and @marcelofabri as a followup.

I am still in favor of perhaps finding a more thorough method of determining if a rule should be implemented as opt-in. I also agree with @marcelofabri that we should aim having most rules as default and be opinionated as other linters, but those opinions should be backed by a community standard or some sort of a majority, and not just by a portion of developers IMO.

@idrougge
Copy link

idrougge commented Aug 6, 2019

I agree that this rule is not established well enough in the Swift community as preferable (many would say that if let _ = is more idiomatic Swift) to warrant being enabled by default.

@stale
Copy link

stale bot commented Nov 8, 2020

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale bot added the wontfix Issues that became stale and were auto-closed by a bot. label Nov 8, 2020
@stale stale bot closed this as completed Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions. wontfix Issues that became stale and were auto-closed by a bot.
Projects
None yet
Development

No branches or pull requests

4 participants