-
Notifications
You must be signed in to change notification settings - Fork 205
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
[Grant Lee] Duke Increments #161
base: master
Are you sure you want to change the base?
Conversation
Add toolVersion block in to Gradle code sample to prevent errors.
Change file mode on `gradle` to be executable (#9)
Gradle defaults to an empty stdin which results in runtime exceptions when attempting to read from `System.in`. Let's add some sensible defaults for students who may still need to work with the standard input stream.
Add configuration for console applications
The OpenJFX plugin expects applications to be modular and bundled with jlink, resulting in fat jars that are not cross-platform. Let's manually include the required dependencies so that shadow can package them properly.
# Conflicts: # src/main/java/Deadline.java
this.dayTime = Parser.parseTime(dayTime); | ||
} | ||
|
||
public String getDayTime() { |
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.
"dayTime" may not be as intuitive of a variable name to use
src/main/java/EventException.java
Outdated
@@ -0,0 +1,10 @@ | |||
public class EventException extends DukeException { | |||
public EventException() { |
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.
Non-intuitive Class Name.
src/main/java/TodoException.java
Outdated
@@ -0,0 +1,10 @@ | |||
public class TodoException extends DukeException { |
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.
Non-Intuitive Class Name
src/test/java/TaskTest.java
Outdated
} | ||
|
||
@Test | ||
public void getStatusIcon_todo_ok() { |
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.
Invalid function name
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.
Test functions should start with the word "test" and use camelCase instead of underlined_function_names
@@ -0,0 +1,3 @@ | |||
todo buy fruits |
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.
Could have more extensive tests
tutorials/gradleTutorial.md
Outdated
@@ -1,4 +1,4 @@ | |||
# Gradle Tutorial | |||
de# Gradle Tutorial |
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 believe this was an unintentionally commit
# Conflicts: # src/main/java/TaskList.java
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.
Please go through the detailed comments given especially handling Duke specific exceptions. You can discuss it with your team as well so that it will benefit you and the team project. You may focus on writing more Junit test cases as well.
src/main/java/DeadlineException.java
Outdated
|
||
@Override | ||
public String getMessage(){ | ||
return "\u2639 OOPS!!! The description of a deadline cannot be empty."; |
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.
Why it is always the same message for all DeadlineException? If this exception is dedicated for empty description, then you can have class name that indicates the purpose. E.g. EmptyDescriptionException
src/main/java/Duke.java
Outdated
+ "| |_| | |_| | < __/\n" | ||
+ "|____/ \\__,_|_|\\_\\___|\n"; | ||
System.out.println("Hello from\n" + logo); | ||
// String logo = " ____ _ \n" |
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.
Please remove commented code blocks
src/main/java/DukeException.java
Outdated
|
||
@Override | ||
public String getMessage(){ | ||
return "\u2639 OOPS!!! I'm sorry, but I don't know what that means :-("; |
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 this Exception dedicated for unavailable commands? Then you can use a class name which indicates that
src/main/java/EventException.java
Outdated
|
||
@Override | ||
public String getMessage(){ | ||
return "\u2639 OOPS!!! The description of an event cannot be empty."; |
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.
Same goes here. You can either have a generic Exception class which can handle different exceptions or you can make the Class name more intuitive
src/main/java/Parser.java
Outdated
String msg = ""; | ||
if (input.equals("list")) { | ||
msg = taskList.showList(); | ||
} else if (input.split(" ")[0].equals("done")) { |
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.
If input.split(" ")[0] is repeated, again and again, then you can define that as a string and use it.
src/main/java/TaskList.java
Outdated
Task toAdd = new Task(); | ||
if (typeOfTask.equals("todo")) { | ||
try { | ||
String task = s.split(" ", 2)[1]; |
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.
Same goes here. If this logic is repeated, you can extract it out before the if statement
src/main/java/TaskList.java
Outdated
*/ | ||
public String delete(int i) { | ||
Task t = taskList.remove(i-1); | ||
String msg = "Poof! This task is gone:\n" |
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.
You can define these messages as constants if they are not going to change
src/main/java/Ui.java
Outdated
* @param s String to print. | ||
*/ | ||
public void print(String s) { | ||
System.out.println(s); |
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.
Why do you need a separate method only to execute System. out.println
src/main/java/Ui.java
Outdated
public Ui() {} | ||
|
||
/** | ||
* Prints string. |
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.
You can avoid trivial comments
Add a few assertions
A-CodeQuality
Provide support for managing tasks that need to be done within a certain period
No description provided.