-
Notifications
You must be signed in to change notification settings - Fork 5
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
Modify delete using student number #56
Modify delete using student number #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just some issues with code style and formatting, and making the code pass CI. 😊
One small suggestion for future iterations could be to include both delete by index or student number, but both cannot be supplied at once.
@@ -14,7 +14,9 @@ public class Messages { | |||
|
|||
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command"; | |||
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s"; | |||
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The person index provided is invalid"; | |||
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The peron index provided is invalid"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small spelling mistake here for 'person'
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes a person. " | ||
+ "Parameters: " | ||
+ PREFIX_STUDENTNUMBER + "STUDENT NUMBER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline could be added for better readability. 😊
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes a person. " | |
+ "Parameters: " | |
+ PREFIX_STUDENTNUMBER + "STUDENT NUMBER" | |
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes a person.\n" | |
+ "Parameters: " | |
+ PREFIX_STUDENTNUMBER + "STUDENT NUMBER\n" |
throw new CommandException(Messages.MESSAGE_INVALID_STUDENT_NUMBER); | ||
} | ||
|
||
if (!model.hasPerson(new Person(targetStudentNumber))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to check if model has person using Student number without creating a Person object?
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
============================================
+ Coverage 77.28% 77.34% +0.05%
+ Complexity 492 491 -1
============================================
Files 78 78
Lines 1585 1598 +13
Branches 158 153 -5
============================================
+ Hits 1225 1236 +11
- Misses 313 314 +1
- Partials 47 48 +1
|
LGTM! |
Closes #55