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

Make all arguments as keyword arguments #81

Closed
wants to merge 2 commits into from

Conversation

gaiksaya
Copy link
Member

@gaiksaya gaiksaya commented Nov 22, 2023

Description

Making args consistent with this change. It was a combination of positional args and keywords args causing confusing. This should help later on when we extend the stack to import the context variables as props too. With all args being keywords, the user need not worry about the order. This is a good practice when the number of arguments are more in number.

Also fixes the typo in readme. Following best practices keep security as enabled for sample command.

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Sayali Gaikawad <[email protected]>
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (521aeb5) 78.57% compared to head (06d1db2) 78.57%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #81   +/-   ##
=======================================
  Coverage   78.57%   78.57%           
=======================================
  Files           6        6           
  Lines         434      434           
  Branches      130      130           
=======================================
  Hits          341      341           
  Misses         93       93           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Sayali Gaikawad <[email protected]>
@@ -249,30 +249,30 @@ export class OsClusterEntrypoint {
securityDisabled: security,
opensearchVersion: distVersion,
clientNodeCount: clientCount,
cpuArch,
cpuArch: cpuArch,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it make any difference?
Since passed argument name and accepting parameter name is same, having parameter1: argument1 is same as parameter1. Or is it different?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think variable name as any significance in mapping (I might be wrong). This is to keep the args consistent and not worry about naming or order of arguments (positional) since the list is only going to grow from now on. Recommending to choose one for better maintenance and passing between classes.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right! TS is weird. The compiler is resetting in my local too. Found this: https://stackoverflow.com/questions/49798156/typescript-variable-name-as-interface-type
Do you think it is a better idea to have different variable names than the keyword arguments to be passed onto as key value pairs ? If not you can close this PR @rishabh6788

@gaiksaya gaiksaya closed this Dec 16, 2023
@gaiksaya gaiksaya deleted the args branch December 16, 2023 03:04
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