-
Notifications
You must be signed in to change notification settings - Fork 438
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
[Li Beining] iP #453
base: master
Are you sure you want to change the base?
[Li Beining] iP #453
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.
Keep up the good work! Just a few nits to make and LGTM. Don't forget to add JavaDoc for the public methods and classes 👍
package Duke.exceptions; | ||
|
||
public class DukeException extends Exception { | ||
public DukeException(String errorMessage) { |
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.
Can consider adding an empty line here so as to standardize with the rest of the files, just something trivial 👍
|
||
import java.lang.annotation.Inherited; | ||
|
||
public enum TaskType { |
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 like how you consolidate the possible task types in enum class for checking 👍
src/main/java/Duke/utils/Parser.java
Outdated
public class Parser { | ||
|
||
public static Command parse(String command) throws DukeException { | ||
if(command.equals("bye")) { |
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.
Should there be a space here? Eg: if[space](command...
I notice this in some other places as well, feel free to edit! :)
import Duke.utils.Ui; | ||
|
||
public class AddCommand extends Command { | ||
String taskType; |
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.
Shall we privatize variables for encapsulation? If I'm not mistaken, its part of the coding standard that this mod enforces
Task task; | ||
String[] parts = data.split("( \\| )"); | ||
switch(parts[0]){ | ||
case("T"): |
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.
Should there be no indentation after switch case? You can change the IDE formatting in settings for this :)
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 notice this is some other places as well. Feel free to edit
public static void save(String path, String fileName, List<String> data) { | ||
|
||
File directory = new File(path); | ||
if (! directory.exists()){ |
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.
Should there be no space after "!" ?
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.
Overall very good naming convention, and follow code quality very well, good abstraction also. could consider making commits more detailed, and in present tense.
return tasks.size(); | ||
} | ||
|
||
public Task get(int index) { |
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 consider being more specific such as 'getTask'?
return tasks.get(index); | ||
} | ||
|
||
public void remove(int index) { |
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.
Similarly could also try being more specific here?
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.
week 4 ip PR review on coding standard
README.md
Outdated
@@ -15,7 +15,7 @@ Prerequisites: JDK 11, update Intellij to the most recent version. | |||
1. Click `Open or Import`. | |||
1. Select the project directory, and click `OK` | |||
1. If there are any further prompts, accept the defaults. | |||
1. After the importing is complete, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()`. If the setup is correct, you should see something like the below: | |||
1. After the importing is complete, locate the `src/main/java/duke.java` file, right-click it, and choose `Run duke.main()`. If the setup is correct, you should see something like the below: |
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.
It is better for "duke" to be PascalCase.
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 I remember correctly, the standard convention is that folders will be in small letters, whereas classes to start with capital letter. Maybe you can double confirm this first before the change :)
|
||
/** | ||
* Represents command that stops the Duke from running upon execution. | ||
*/ |
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.
Documentation format is a bit off.
return true; | ||
} | ||
|
||
@Override |
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.
Can add javadoc for this method.
@@ -0,0 +1,102 @@ | |||
package duke.task; |
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.
Can add javadoc to this class
src/main/java/duke/utils/Parser.java
Outdated
@@ -0,0 +1,48 @@ | |||
package duke.utils; | |||
|
|||
import duke.command.*; |
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.
Can be more specific instead of using "*".
@@ -0,0 +1,66 @@ | |||
package duke.utils; | |||
|
|||
import duke.command.*; |
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.
Can be more specific instead of using "*".
Branch a code quality
add extension help command
No description provided.