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

[Core] Refactor CommandLine arguments #2130

Merged
merged 8 commits into from
Sep 26, 2020
Merged

[Core] Refactor CommandLine arguments #2130

merged 8 commits into from
Sep 26, 2020

Conversation

ltpquang
Copy link
Contributor

@ltpquang ltpquang commented Sep 25, 2020

Problem

I'm about to call Cucumber main function from my own app

public static void main(String[] args) {
        io.cucumber.core.cli.Main.main(args);
}

For better management, I would standardize my app's arguments, before passing to Cucumber.

The problem is Cucumber's arguments are now hardcoded, which make future updates maybe break my app.

Solution

Define all arguments as static string variables. This makes arguments more consistent, and cleaner codebase.

Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

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

This is useful. Since this class is to be used in combination with the main class it would make sense to put it in the same package. It is essentially an interface for public consumption..

@coveralls
Copy link

coveralls commented Sep 25, 2020

Coverage Status

Coverage decreased (-0.03%) to 86.464% when pulling be01e58 on ltpquang:main into 2c6652d on cucumber:main.

- Rename for shorter naming
- Move to io.cucumber.core.cli
- Annote with @API
- Make the class final, disable instantiating
CHANGELOG.md Outdated Show resolved Hide resolved
core/src/main/java/io/cucumber/core/cli/CLIOptions.java Outdated Show resolved Hide resolved
Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

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

Almost there!

CHANGELOG.md Outdated Show resolved Hide resolved
@mpkorstanje
Copy link
Contributor

I pushed some changes. Let me know what you you think.

@ltpquang
Copy link
Contributor Author

I pushed some changes. Let me know what you you think.

Thanks @mpkorstanje , everything seems to be great now. But for later PRs, what changes will be categorized as Added, and what will be categorized as Changed, in the CHANGELOG? Since my PR changes some behavior, by adding some variables, this makes me a little bit confused.

@mpkorstanje
Copy link
Contributor

We're using Keep a Changelog as a guide: https://keepachangelog.com/en/1.0.0/

Types of changes

Added for new features.
Changed for changes in existing functionality.
Deprecated for soon-to-be removed features.
Removed for now removed features.
Fixed for any bug fixes.
Security in case of vulnerabilities.

Since this wasn't existing behaviour, changed does not apply.

@ltpquang
Copy link
Contributor Author

We're using Keep a Changelog as a guide: https://keepachangelog.com/en/1.0.0/

Types of changes

Added for new features.
Changed for changes in existing functionality.
Deprecated for soon-to-be removed features.
Removed for now removed features.
Fixed for any bug fixes.
Security in case of vulnerabilities.

Since this wasn't existing behaviour, changed does not apply.

@mpkorstanje Got it. Everything is clear by now, please continue PR process as I don't have any further comments. Thank you!

@mpkorstanje mpkorstanje merged commit b84c582 into cucumber:main Sep 26, 2020
@aslakhellesoy
Copy link
Contributor

Hi @ltpquang,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

mpkorstanje added a commit that referenced this pull request Sep 26, 2020
Define CLI arguments as constants instead of hardcoded strings.

Co-authored-by: M.P. Korstanje <rien.korstanje@gmail.com>
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.

4 participants