-
Notifications
You must be signed in to change notification settings - Fork 228
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
[Wang Haochen] iP #233
base: master
Are you sure you want to change the base?
[Wang Haochen] iP #233
Conversation
add date time recognition
Add junit tests for DateValidator & Task classes
Add level-9 Find
add missing branch
Branch a coding standard
Fix incorrect branch name
src/main/java/ssagit/Duke.java
Outdated
/** Create validator for dates */ | ||
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("d/MM/yyyy HHmm", Locale.ENGLISH); | ||
DateValidator validator = new DateValidatorLocalDate(dateFormatter); | ||
/** Handler for all UI stuff. */ |
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.
I think adding an empty line between these logical blocks would help readability
src/main/java/ssagit/Duke.java
Outdated
@@ -0,0 +1,36 @@ | |||
package ssagit; |
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.
Seems a little odd that your package is called ssagit when the application is still called duke.
/** | ||
* Checks if date given is valid, in the following order: | ||
* date - time - locale; | ||
* If all 3 fails, return with invalid, otherwise return results. |
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.
public boolean isValid(String dateStr) { | ||
LocalDateTime ldt = null; | ||
|
||
try { |
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.
This is really hard to read, why do you need to catch the same kind of exception in so many different places? Maybe there's a way to have only one try-catch block?
/** | ||
* Handler for all UI displays of Duke.java | ||
*/ | ||
public class ConsoleUI { |
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.
I think UI should be Ui (lowercase i)
/** | ||
* Exception class for missing todoTask descriptor. | ||
*/ | ||
static class MissingTodoDescriptorException extends Exception { |
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.
I feel these exceptions should be under a different class, like a DukeException suggested in the project guide
* @param tasks List of tasks from file. | ||
* @param taskIterator Integer to count number of tasks at a time. | ||
*/ | ||
public void parseInput(Task[] tasks, int taskIterator) { |
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.
Whew this is long, maybe try moving some logic to other methods.
break; | ||
case "todo": | ||
case "event": | ||
case "deadline": |
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.
This doesn't seem like good practice to me, should handle the todo and event in their respective cases I feel
test CI
add accessors
resolve issue with filePath (fP), remove FP assertion
Add file counter, add media resources
Update javafx and final cleanup
Pull request for week 3 iP