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

Adopt SPM #21

Closed
TiagoMaiaL opened this issue Jun 9, 2021 · 8 comments
Closed

Adopt SPM #21

TiagoMaiaL opened this issue Jun 9, 2021 · 8 comments

Comments

@TiagoMaiaL
Copy link
Contributor

TiagoMaiaL commented Jun 9, 2021

Hello, everyone.

I've started my studies on algorithms, and I found this project pretty interesting and with lots of potential. I've already opened my first PR, and, while doing it, I've noticed we can't open the whole repository on Xcode (12.5). In order to test the code I was writing, I needed to develop it in a separate project, so I could then migrate it to this repository. I believe we can solve this issue by turning this repository into a Swift package. This would have the following advantages:

  • Development right into the repository
  • Possibility to add unit tests, covering the implementations
  • Possibility for others to explore and learn by integrating it into existing projects

What do you think about it?

@TiagoMaiaL
Copy link
Contributor Author

I was exploring the organization repositories, and it turns out this idea was implemented in other languages as well: TheAlgorithms/Java#474

@distressedrook
Copy link

I really want to take this work up. Any guidelines?

@TiagoMaiaL
Copy link
Contributor Author

TiagoMaiaL commented Jun 22, 2021

Initially, we could create an initial manifest file (Package.swift). It would describe the relevant aspects of this repository. I believe that just by having it there would allow us to use Xcode and the build system. This alone would improve the development experience, as we would be able to build, check for errors, have syntax highlighting, etc...

A second step would be to validate that all files are compiling correctly, fixing the ones that aren't right. This might require some combined effort.

The third step would be to allow the contributors to write and run unit tests over their implementations. This third step could be on a separate PR.

@distressedrook
Copy link

@TiagoMaiaL These are brilliant ideas.

If I might add, what do you think about making the contributions test-driven? We could split contributions up to two types: one that adds test cases for a particular algorithm and another that implements the algorithm after the test-cases are sufficiently exhaustive.

@TiagoMaiaL
Copy link
Contributor Author

TiagoMaiaL commented Jun 23, 2021

@avismarahl I believe adding unit tests is a good idea, but enforcing them might go against the organization goals, which are to welcome everyone to contribute and learn. Not everyone knows about unit tests, TDD, or Swift. So I believe we could add the support for it, and, if the contributors want, they can cover their implementation with a test suite, or even cover an implementation that doesn't have a test suite.

One thing I believe would be a good idea to enforce is that the contributor changes don't break any existing unit tests.

@distressedrook
Copy link

distressedrook commented Jun 23, 2021

Gotcha. Makes sense.

Also, how active is this repo? These changes are not trivial, we might need a couple of folks to see this through.

I just managed to move the entire repo into a Swift package. Even was able to run a couple of test cases. How do we continue from here?

@TiagoMaiaL
Copy link
Contributor Author

TiagoMaiaL commented Jun 23, 2021

@avismarahl You can submit a PR with the manifest, I can test and review it. As I'm not a maintainer, we'd need the review from a maintainer as well.

@distressedrook
Copy link

Done.

I also observed that the naming conventions etc. aren't standard. Probably will take this up soon as well.

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

No branches or pull requests

2 participants