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

Finished conversion to Swift 4 #57

Closed
wants to merge 8 commits into from
Closed

Finished conversion to Swift 4 #57

wants to merge 8 commits into from

Conversation

Davidde94
Copy link

Conversion to Swift 4.0.3 has been finalised, with all warnings removed.

Motivation and Context

The warnings were irritating me across several projects.

How Has This Been Tested?

Using the already-existing test suite

Checklist:

  • I have submitted a CLA form
  • If applicable, I have updated the documentation accordingly.
  • If applicable, I have added tests to cover my changes.

@CLAassistant
Copy link

CLAassistant commented Feb 15, 2018

CLA assistant check
All committers have signed the CLA.

@quanvo87
Copy link
Collaborator

Great! I'll review and re-run Travis some time today. Travis build won't pass unless I do that. (We need to change this)

@@ -149,7 +149,7 @@ extension String {
throw SMTPError(.createEmailRegexFailed)
}

let range = NSRange(location: 0, length: self.characters.count)
let range = NSRange(location: 0, length: self.count)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could remove self in self.count here if you wanted.

Copy link
Author

Choose a reason for hiding this comment

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

Does IBM have any Swift style guidelines I could follow in the future? I understand that Swift typically advises against using "self", but didn't change it in this instance as it was used in "self.characters.count".

Copy link
Contributor

Choose a reason for hiding this comment

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

In general we've followed https://github.com/raywenderlich/swift-style-guide although it's a bit out of date now. Removing self. in this case is a good idea :)

Copy link
Author

Choose a reason for hiding this comment

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

Thanks :)

@quanvo87
Copy link
Collaborator

Looking into how to get the Travis build working again.

@ianpartridge
Copy link
Contributor

Hmm, still failing. @quanvo87 will try another tactic...

@Davidde94
Copy link
Author

@ianpartridge @quanvo87 you could always just take my word that it works? Who needs thorough testing, right?

@quanvo87
Copy link
Collaborator

That's half the fun :)

@quanvo87 quanvo87 mentioned this pull request Feb 15, 2018
@quanvo87
Copy link
Collaborator

I've implemented a new dev ops flow. It is an improvement over the old one, but we still cannot get around the fact that Travis repo env vars are not available to forks (for good reason). So for now, I've pulled this PR into a PR of my own, #58. Tests pass because my PR is not a fork and Travis can access the repo env vars. I'll merge and provide credit to @Davidde94 in the release notes.

Future considerations for dev ops improvements could be:

  • changing the tests to not be end, but mock the smtp protocol instead
  • change any tests that are against a live smtp server to not run on forks, and when forks get merged, automatically trigger a build on the main repo (is this possible?)
  • others?

@quanvo87
Copy link
Collaborator

@quanvo87 quanvo87 closed this Feb 16, 2018
@ianpartridge
Copy link
Contributor

Thanks for doing this @quanvo87 !

@Davidde94
Copy link
Author

Thanks :)

@ianpartridge
Copy link
Contributor

@quanvo87 re: others? Change unit tests to use a botnet spam relay, so no auth is required?

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.

None yet

4 participants