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

Begin work on version 4.0 API changes #133

Merged
merged 14 commits into from
Jun 1, 2017
Merged

Conversation

drmohundro
Copy link
Owner

This is to track the initial work on #84 - I'm not positive how many new features will make this release, but I'd definitely like to clean up some of the nil checks (whether by allowing defaults or some other means).

I'd welcome any additional PRs to this branch if others would like to see additional changes make it for the 4.0 release.

Per issue #132, XMLElement can't be nil because of how the reduce
implementation works. Instead, it will be an empty string. I think this
makes more sense than allowing for nils anyway.

A lot of the suggestions mentioned on issue #84 are related to reducing
the number of nil checks as well, so this should help alleviate some of
that.
@codecov-io
Copy link

codecov-io commented May 14, 2017

Codecov Report

Merging #133 into master will decrease coverage by 1.73%.
The diff coverage is 32.27%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #133      +/-   ##
========================================
- Coverage   27.73%    26%   -1.74%     
========================================
  Files          13     13              
  Lines        1900   1919      +19     
========================================
- Hits          527    499      -28     
- Misses       1373   1420      +47
Impacted Files Coverage Δ
Tests/SWXMLHashTests/WhiteSpaceParsingTests.swift 0% <0%> (ø) ⬆️
...ts/SWXMLHashTests/LazyWhiteSpaceParsingTests.swift 0% <0%> (ø) ⬆️
Tests/SWXMLHashTests/LazyXMLParsingTests.swift 0% <0%> (ø) ⬆️
Tests/SWXMLHashTests/XMLParsingTests.swift 0% <0%> (ø) ⬆️
Source/SWXMLHash+TypeConversion.swift 58.74% <31.7%> (-2.8%) ⬇️
Source/SWXMLHash.swift 75.22% <40.22%> (-6.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4be94ca...31435da. Read the comment docs.

The `attributes` property has been deprecated for a while, so 4.0 will
now remove this property in lieu of `attributes(by: name)` or
`allAttributes`.
@norio-nomura
Copy link
Contributor

norio-nomura commented May 20, 2017

FYI, we found that Swift 4.0 is introducing breaking changes affecting to SWXMLHash and filed SR-4951.
I don't think that issue may be avoidable by using -swift-version 3.

@drmohundro
Copy link
Owner Author

@norio-nomura thanks for the heads up - I'll start watching that issue, but can plan to rename Element if necessary.

@norio-nomura
Copy link
Contributor

but can plan to rename Element if necessary.

Just an Element? or lowercase enums?

@drmohundro
Copy link
Owner Author

Yeah, I think lower case makes sense - I think I had intended to follow Swift conventions, but most of the things I'm seeing now are lowercase so that makes the most sense to me right now.

@norio-nomura
Copy link
Contributor

I have a branch that changes enums to lowercase for building with Swift 4.

@drmohundro
Copy link
Owner Author

Nice! I guess the only thing that would have to change before merging it into the 4.0 branch would be the @available renamed attributes. I'm happy to merge that into 4.0 here.

drmohundro and others added 3 commits May 22, 2017 10:38
[4.0] Lower case enums and better Swift 4 compatibility
The recommended naming for enums is camel case so this commit changes
the XMLDeserializationError cases to be named properly. In addition,
Sequence was removed from XMLIndexer so-as to avoid a conflict between
XMLIndexer.element and Sequence.element in Swift 4 - enumerating over
results is still possible by using the `.all` method, though.

// swiftlint:disable identifier_name
// unavailable
#if !swift(>=3.2) // `Sequence.Element` is added on Swift 4.0 including with `-swift-version 3`
Copy link
Contributor

Choose a reason for hiding this comment

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

This #if is no longer needed, since it is no longer Sequence.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed this in #138

norio-nomura and others added 5 commits June 1, 2017 09:38
This fixes attributes tests on Linux.
- `LazyWhiteSpaceParsingTests.testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace`
- `WhiteSpaceParsingTests.testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace`
This is no longer needed since `XMLIndexer` is no longer `Sequence`.
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