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

feat: add ParseGeoPoint convenience methods for CoreLocation #287

Merged
merged 9 commits into from Nov 23, 2021
Merged

feat: add ParseGeoPoint convenience methods for CoreLocation #287

merged 9 commits into from Nov 23, 2021

Conversation

jaysonng
Copy link
Contributor

@jaysonng jaysonng commented Nov 23, 2021

New Pull Request Checklist

Issue Description

Currently devs have add their own convenience methods to deal with CLLocationCoordinate2D.

Also fixes SwiftLint not working for M1 Macs

Related issue: #286

Approach

Add toCLLocation and toCLLocationCoordinate2D for easy conversion from a ParseGeoPoint object.

SwiftLint: Based on https://www.anotheriosdevblog.com/installing-swiftlint-on-a-m1/, added the script to the existing SwiftLint script.

TODOs before merging

  • Add clean to tvOS build in CI to reduce random failures
  • Update SwiftLint script
  • Add tests
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 23, 2021

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@cbaker6 cbaker6 changed the title SwiftLint Fix for M1 Macs fix: enable SwiftLint on M1 Macs Nov 23, 2021
@cbaker6 cbaker6 linked an issue Nov 23, 2021 that may be closed by this pull request
4 tasks
@cbaker6
Copy link
Contributor

cbaker6 commented Nov 23, 2021

@jaysonng thanks for opening your first PR on the repo! Be sure to take note of the updates I made to the description. You will want to only add text where the comments ask it.

Does your changes make swiftlint work on your M1? I don’t have one to test.

Jayson Ng added 2 commits November 23, 2021 12:01
adding toCLLocation and toCLLocationCoordinate2D convenience methods and Tests.
@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #287 (99a0484) into main (b4bdfb1) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
+ Coverage   82.44%   82.46%   +0.01%     
==========================================
  Files         104      104              
  Lines       10596    10607      +11     
==========================================
+ Hits         8736     8747      +11     
  Misses       1860     1860              
Impacted Files Coverage Δ
Sources/ParseSwift/Types/ParseGeoPoint.swift 97.64% <100.00%> (+0.34%) ⬆️

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 b4bdfb1...99a0484. Read the comment docs.

Sources/ParseSwift/Types/ParseGeoPoint.swift Outdated Show resolved Hide resolved
Sources/ParseSwift/Types/ParseGeoPoint.swift Outdated Show resolved Hide resolved
Sources/ParseSwift/Types/ParseGeoPoint.swift Outdated Show resolved Hide resolved
@cbaker6
Copy link
Contributor

cbaker6 commented Nov 23, 2021

You will need to fix the Linux build by ensuring CLLocationCoordinate2D and anything CLLocation is enclosed in:

#if canImport(CoreLocation)

#endif

@jaysonng
Copy link
Contributor Author

@jaysonng thanks for opening your first PR on the repo! Be sure to take note of the updates I made to the description. You will want to only add text where the comments ask it.

Does your changes make swiftlint work on your M1? I don’t have one to test.

yes, i had to get it to work so i can test it on the ParseSwift updates I'm making. this was my fix.

@jaysonng
Copy link
Contributor Author

jaysonng commented Nov 23, 2021

You will need to fix the Linux build by ensuring the CLLocationCoordinate2D is not being compiled on Linux, Android, and Windows

im so confused right now. How come my pull request for the CoreLocation methods and tests are showing up on this PR for SwiftLint?

seems like it's because I pushed the new fixes to the my main branch. should I revert, and create a tree? so it has a separate PR?

…iners

Renaming locationCoordate to coordinate and removing return for one liners
@cbaker6
Copy link
Contributor

cbaker6 commented Nov 23, 2021

Each PR needs to be made from a separate beach. Normally, you would make changes to a branch from the main on your fork for each PR and not to the main main branch directly.

@cbaker6 cbaker6 changed the title fix: enable SwiftLint on M1 Macs feat: parseGeoPoint convenience methods for CoreLocation Nov 23, 2021
@cbaker6 cbaker6 changed the title feat: parseGeoPoint convenience methods for CoreLocation feat: add ParseGeoPoint convenience methods for CoreLocation Nov 23, 2021
@cbaker6
Copy link
Contributor

cbaker6 commented Nov 23, 2021

@mtrezza I will leave this and future PR's on the main so you can test autorelease

@cbaker6 cbaker6 linked an issue Nov 23, 2021 that may be closed by this pull request
3 tasks
@jaysonng
Copy link
Contributor Author

Each PR needs to be made from a separate beach. Normally, you would make changes to a branch from the main on your fork for each PR and not to the main main branch directly.

Got it. I'll keep that in mind for the next PR's I do.

Thanks.

@cbaker6 cbaker6 merged commit 7c53ef3 into parse-community:main Nov 23, 2021
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.

Convenience methods for ParseGeoPoint SwiftLint doesn't work with M1 Macs with the current script.
2 participants