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 ArgumentParser #16

Merged
merged 9 commits into from
May 12, 2024

Conversation

pereBohigas
Copy link
Contributor

@pereBohigas pereBohigas commented Apr 1, 2024

Aloha!!

The Swift's Argument Parser is here being added to the project. Now, useful error messages and a nice help are being shown to the user.

Bildschirmfoto 2024-04-01 um 23 53 40

Following the best practices for command line tools APIs, the languages to be checked are now passed as a list of arguments separated by spaces (e.g. swiftpolyglot en es).

Cheers!!

@roddymunro
Copy link
Member

Thank you for adding this! It's another great step in the right direction.

This seems like a breaking change, seeing as the way we pass in languages is changing. Are there any other potential breaking changes that you may want to make in the short term?

@pereBohigas
Copy link
Contributor Author

pereBohigas commented Apr 4, 2024

Nice to hear that!

I'm currently working on getting the string catalog checks to be executed in parallel, which will force us to set the minimum required macOS version to 10.15 (aka macOS Catalina). I'm not sure if we should consider this a breaking change, but probably yes.

@pereBohigas pereBohigas force-pushed the feature/add_argument_parser branch from 92112ce to 38c1960 Compare April 4, 2024 16:34
roddymunro
roddymunro previously approved these changes Apr 5, 2024
@roddymunro
Copy link
Member

Nice to hear that!

I'm currently working on getting the string catalog checks to be executed in parallel, which will force us to set the minimum required macOS version to 10.15 (aka macOS Catalina). I'm not sure if we should consider this a breaking change, but probably yes.

Ok, sounds good! I doubt anybody is using the package on anything less than macOS 10.15 at this stage.

Small FYI - I'll be on vacation for roughly the next 3 weeks! I'll have my laptop, but I'll be slow to respond.

@roddymunro
Copy link
Member

Just going to test this against my apps before merging.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@roddymunro roddymunro self-requested a review April 5, 2024 02:14
@roddymunro roddymunro dismissed their stale review April 5, 2024 02:55

see comments

@pereBohigas pereBohigas force-pushed the feature/add_argument_parser branch from 38c1960 to a86446f Compare April 5, 2024 16:29
@pereBohigas
Copy link
Contributor Author

pereBohigas commented Apr 5, 2024

Ok, sounds good! I doubt anybody is using the package on anything less than macOS 10.15 at this stage.

Small FYI - I'll be on vacation for roughly the next 3 weeks! I'll have my laptop, but I'll be slow to respond.

Don't worry, there's nothing urgent that can't wait. Enjoy your 🌴!

@pereBohigas pereBohigas mentioned this pull request Apr 11, 2024
@pereBohigas
Copy link
Contributor Author

pereBohigas commented Apr 23, 2024

I have just corrected the command name in the help message, which I had not noticed until now

Bildschirmfoto 2024-04-23 um 23 40 37

Copy link
Member

@roddymunro roddymunro left a comment

Choose a reason for hiding this comment

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

Apologies for the delay in reviewing this! I've just tested against one of my apps and it looks good to me.

Given the breaking changes, I'm thinking it might be a good idea to merge this in to a v1 branch, where we can collect any other changes over the next few weeks before we update main and do an official release. What do you think?

@pereBohigas
Copy link
Contributor Author

pereBohigas commented May 11, 2024

Apologies for the delay in reviewing this! I've just tested against one of my apps and it looks good to me.

Given the breaking changes, I'm thinking it might be a good idea to merge this in to a v1 branch, where we can collect any other changes over the next few weeks before we update main and do an official release. What do you think?

I'm glad to have you back! It's fine for me. Would you like to include #17 also into this branch?

@roddymunro
Copy link
Member

Apologies for the delay in reviewing this! I've just tested against one of my apps and it looks good to me.
Given the breaking changes, I'm thinking it might be a good idea to merge this in to a v1 branch, where we can collect any other changes over the next few weeks before we update main and do an official release. What do you think?

I'm glad to have you back! It's fine for me. Would you like to include #17 also into this branch?

yes!

@roddymunro roddymunro changed the base branch from main to v1 May 11, 2024 21:00
@roddymunro roddymunro merged commit 59968c2 into appdecostudio:v1 May 12, 2024
2 of 4 checks passed
roddymunro added a commit that referenced this pull request Jun 12, 2024
* Add ArgumentParser (#16)

* Add ArgumentParser dependency

* Rename SwiftPolyglotCore struct

* Add RuntimeError

* Rename SwiftPolyglot struct, add ParsableCommand adoption and add RuntimeError usage

* Parse arguments and flag using ArgumentParser and adjust SwiftPolyglotCore initializer's parameters

* Update README

* Rename property

* Format

* Fix command name in help's message

* Add Concurrency (#17)

* Set minimum macOS version to version 10.15 (Catalina)

* Add MissingTranslation struct

* Add concurrency to core functionality

* Adopt AsyncParsableCommand protocol to provide an asynchronous entry point

* Add XCTest extension for testing async throwing expressions

* Add concurrency to tests

* Fix SwiftFormat issues (#19)

* Remove trailing commas

* Fix indentation

* Move inline try to start of expression

* Remove trailing white spaces

* Use opaque generic parameters instead of generic parameters with constraints

* Replace consecutive blank lines with a single blank line

* Disable hoistAwait (#20)

* Fix swiftformat (#21)

* Improve assertions on async throwing expressions (#22)

* Add Equatable adoption for custom error

* Improve custom method for asserting on asynchronous expressions which should run successfully without throwing an error

* Improve custom method for asserting on asynchronous expressions which should throw an error

* Reenable hoistAwait SwiftFormat rule

---------

Co-authored-by: Pere Bohigas <[email protected]>
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