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

Add redundant nil coalesing operator opt-in rule #773

Merged

Conversation

daniel-beard
Copy link
Contributor

@@ -8,7 +8,9 @@

##### Enhancements

* None.
* Add `RedundantNilCoalesingRule` Opt-In rule that warns against `?? nil`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing two trailing spaces, as noted in contributing.md

Also, this should be moved to a new top-level changelog section now that 0.12.0 is out.

@jpsim
Copy link
Collaborator

jpsim commented Aug 24, 2016

I feel like this could easily conform to CorrectableRule.

@daniel-beard daniel-beard force-pushed the dbeard_redundant_nil_coalesing_operator_rule branch from 39af02e to 33a817e Compare August 24, 2016 20:23
@daniel-beard
Copy link
Contributor Author

daniel-beard commented Aug 24, 2016

@jpsim updated. I'll add CorrectableRule changes in a future PR

@daniel-beard
Copy link
Contributor Author

Not sure why the build is stuck...

@jpsim
Copy link
Collaborator

jpsim commented Aug 24, 2016

The build is stuck because Travis isn't running OS X jobs at this time:

We've identified issues with multiple OSX build hosts and we're working with our infrastructure provider to resolve this, as well as performing some maintenance tasks to help improve stability. Builds will continue to be paused while we work through this.

https://www.traviscistatus.com/


* Add `RedundantNilCoalesingRule` Opt-In rule that warns against `?? nil`.
[Daniel Beard](https://github.com/daniel-beard)
[#764](https://github.com/realm/SwiftLint/issues/764)
Copy link
Collaborator

Choose a reason for hiding this comment

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

trailing whitespace is at the wrong place. see other changelog entries for format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it, fixed.

@jpsim
Copy link
Collaborator

jpsim commented Aug 24, 2016

This is missing a test in RulesTests.swift. Otherwise looks good, but I'll want to wait for Travis to be back online.

@daniel-beard daniel-beard force-pushed the dbeard_redundant_nil_coalesing_operator_rule branch from 33a817e to 63d73b2 Compare August 24, 2016 22:21
@daniel-beard daniel-beard force-pushed the dbeard_redundant_nil_coalesing_operator_rule branch from 63d73b2 to 4cb4401 Compare August 24, 2016 22:25
@daniel-beard
Copy link
Contributor Author

Added test as well.

@jpsim
Copy link
Collaborator

jpsim commented Aug 24, 2016

👍 local test passes so merging.

@jpsim jpsim merged commit 7e48da0 into realm:master Aug 24, 2016
@daniel-beard daniel-beard deleted the dbeard_redundant_nil_coalesing_operator_rule branch August 24, 2016 22:34
@marcelofabri marcelofabri mentioned this pull request Oct 15, 2016
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.

2 participants