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

Added code to make slots optional #24

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

dominicankev
Copy link

Added code to make slots optional by adding a "+" to the beginning and end of of desired slot name.

For example: {+OPTIONALSLOT+|}

@dblock
Copy link
Collaborator

dblock commented Jan 18, 2017

You should write some tests and update README and CHANGELOG, please.

@harrisonhjones
Copy link

harrisonhjones commented Jan 18, 2017

@dblock Perhaps it would be a good ideal to add a literal checklist to CONTRIBUTING? Or a issue template? Also there's no mention of updating the changelog in CONTRIBUTING

@dominicankev It looks like you used tabs instead of spaces for indenting your code. Please fix.

@dblock
Copy link
Collaborator

dblock commented Jan 18, 2017

@mreinstein is the boss here, but I support this message, maybe you can PR it?

@dominicankev
Copy link
Author

Hey guys. I apologize. Kind of new to the GitHub community and might have gotten a bit excited to post a commit. Should I cancel and update the files requested?

@harrisonhjones
Copy link

@dominicankev No worries! PRs are (in general) good to see. As for updating this PR see here.

@dominicankev
Copy link
Author

@harrisonhjones Thanks! Will make the requested revisions. Thanks all!

test/index.js Outdated
@@ -111,15 +111,19 @@ test('exhaustive vs non-exhaustive expansion', function (t) {

test('raw curly braces for custom slot types', function (t) {

Choose a reason for hiding this comment

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

In my opinion you should add a new test instead of repurposing an existing one.

test/index.js Outdated
"your favorite fruit is {Fruit} in {ROOM_NAME}",
"my least favorite fruit is {Fruit} in {ROOM_NAME}",
"your least favorite fruit is {Fruit} in {ROOM_NAME}",
"my favorite fruit is {Fruit} ",

Choose a reason for hiding this comment

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

Anyway to get rid of the hanging at the end of the line?

Copy link
Author

@dominicankev dominicankev Jan 18, 2017

Choose a reason for hiding this comment

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

@harrisonhjones If I trim the trailing space it seems to break the "optional terms" test which also has trailing spaces in the result. I can add a trim to the returned utterances ( ie: return utterances.trim(); ) but not sure if that would be desired or not.

Choose a reason for hiding this comment

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

No doubt. Here's what I would do:

  1. Update the code to trim the whitespace (or not add it in the first place)
  2. Add a new test for the optional terms which doesn't include the trailing white space
  3. Run all the tests with your new code. They should all pass
  4. Report back if you have issues

Copy link
Author

Choose a reason for hiding this comment

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

@harrisonhjones Cool. Thanks. Was thinking of doing that but wasn't sure if the trailing space was desired or not. Assumed it wasn't. It's more of a result of the utterance containing the space and the optional value not being there. Will give it a shot. Thanks again.

CHANGELOG.md Outdated
@@ -1,6 +1,6 @@
### Next
### 0.2.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't add a version here, the maintainer will do that when they do a release.

Copy link
Author

Choose a reason for hiding this comment

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

@dblock Thanks. Wasn't sure on that piece. Will update.

CHANGELOG.md Outdated

* Your contribution here.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Put this back for the next person please.

@dominicankev
Copy link
Author

Fixed space vs tab issues and trimmed test to reflect change instead of using existing.

jradwan referenced this pull request in jradwan/alexa_tivo_control Jan 30, 2017
@jradwan
Copy link

jradwan commented Aug 20, 2017

Any idea if/when this PR will be merged?

@mreinstein
Copy link
Contributor

@dominicankev thanks for taking the time to submit. Please submit a clean PR that includes tests.

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.

None yet

5 participants