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

[W5] [T12-4] Jeremy Yiren Low #171

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

[W5] [T12-4] Jeremy Yiren Low #171

wants to merge 6 commits into from

Conversation

lormee94
Copy link

Summary:
Simple undo that only works on the previous command.
Works with add or delete commands only (wanted to do list but I need a break..)

@jetkan-yk
Copy link

Very interesting feature! In fact, this might be the most creative enhancement I've ever seen. Bravo!

#LATB

@jetkan-yk
Copy link

Here's my two cents on the commit message: try to keep it short (<50 char) & the title should be in present tense e.g. "Add...", "Update...", "Change...". For additional information, put it in a paragraph instead of the title commit message.

Here's some useful links to learn more about writing a good commit message:
https://chris.beams.io/posts/git-commit/
https://code.likeagirl.io/useful-tips-for-writing-better-git-commit-messages-808770609503

#LATB

Copy link

@nhs-work nhs-work left a comment

Choose a reason for hiding this comment

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

Fantastic job on your first PR! You have managed to demonstrate a great understanding of the addressbook. Unfortunately, you forgot to update the User Guide and JUnit tests. Make sure to always update documentation and all tests whenever you make changes. Keep up the good work! 👍

@@ -32,6 +33,8 @@
/** The list of person shown to the user most recently. */
private List<? extends ReadOnlyPerson> lastShownList = Collections.emptyList();

/** The previous command entered by user. */
private String PreviousUserCommand = Messages.HISTORY_EMPTY;

Choose a reason for hiding this comment

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

Don't forget to follow camelCase!

+ "\n" + ViewCommand.MESSAGE_USAGE
+ "\n" + ViewAllCommand.MESSAGE_USAGE
+ "\n" + HelpCommand.MESSAGE_USAGE
+ "\n" + ExitCommand.MESSAGE_USAGE
);
, true);

Choose a reason for hiding this comment

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

Note that you should break after a comma and that this line should be indented as well.

try {
addressBook.removeLastPerson();
}
catch (UniquePersonList.PersonNotFoundException pnfe) {

Choose a reason for hiding this comment

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

Catch statements should be on the same line as the closed brace of the previous try/catch closed brace.

} catch (IndexOutOfBoundsException ie) {
return new CommandResult(Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);
return new CommandResult(Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX, true);

Choose a reason for hiding this comment

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

Shouldn't this return false as the second parameter?

*/
public void removeLastPerson() throws PersonNotFoundException {
Iterator<Person> itr = allPersons.iterator();
assert itr.hasNext();

Choose a reason for hiding this comment

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

Great use of assertions here to verify the program's state!

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.*;

Choose a reason for hiding this comment

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

Imported classes should always be listed explicitly.

import seedu.addressbook.commands.ListCommand;
import seedu.addressbook.commands.ViewAllCommand;
import seedu.addressbook.commands.ViewCommand;
import seedu.addressbook.commands.*;

Choose a reason for hiding this comment

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

Imported classes should always be listed explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants