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

[szejiancheng] iP #205

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

Conversation

szejiancheng
Copy link

@szejiancheng szejiancheng commented Jan 25, 2023

Introducing Duke, the CLI task assistant!

It's so easy, even a Y2 CS student can use it! 👍 - someone

source

Duke stores all your tasks so you don't have to! Now supporting:
  • Todos
  • Deadlines
  • Events
  • And more!

All you need to do is,

  1. Download the JAR file here
  2. Unzip it into somewhere convenient
  3. Open and run it
  4. Simply type commands into the command line and let Duke help you remember them!

Features:

  • Task adding, removing, marking, and saving
  • Finding an added task Coming soon!
  • GUI Coming soon!
if (this.userApproval = HIGH) {
    this.merge();
}

damithc and others added 17 commits July 31, 2022 17:20
…es to reflect new error messages in EXPECTED.txt and input.txt
From Level-7 requirements. Using java.nio.file classes to save on String parsing.
In order to facillitate more complicated instruction parsing,
consolidated all command parsing under recieveInput
Taught duke how to understand dates
# Conflicts:
#	src/main/java/DukeBehaviour.java
What it says on the tin, was confused and had to figure out where Level-7 went to
Encapsulate the various components of Duke's execution in seperate classes
Copy link

@ryanjansen ryanjansen left a comment

Choose a reason for hiding this comment

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

Looks good, just some small cosmetic changes. The code was easy to read and made sense!

ArrayList<String> tokens = new ArrayList<>(Arrays.asList(input.split(" ")));
tokens.removeIf(s -> s.equals(" ") || s.equals(""));
tokens.forEach(s -> s = s.trim());
//System.out.println(tokens);

Choose a reason for hiding this comment

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

Can remove this.

this.isDone = false;
}


Choose a reason for hiding this comment

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

Can remove.

super(tokens);
int byId = tokens.indexOf("/by");
if (byId < 0){
throw new DukeException("Invalid input received! \nDeadline commands are in the form of: deadline name /by bytime \n(remember to include '/by')");

Choose a reason for hiding this comment

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

Can add line breaks for style.

Copy link

@StanleyNeoh StanleyNeoh left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just some minor styling issues here and there.

String name = String.join(" ", tokens.subList(1, byId));
LocalDate by = LocalDate.parse(String.join(" ", tokens.subList(byId+1, tokens.size())));
Deadline newDeadline = new Deadline(name, by);
super.setTaskToAdd(newDeadline);

Choose a reason for hiding this comment

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

As AddDeadlineCommand extends AddCommand, the command setTaskToAdd should work without the super in front. You should be able to just call it directly.


@Override
public String toString() {
return "[D]" + super.toString() + " (by: " + by.format(format) + ")";

Choose a reason for hiding this comment

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

As [D] shows up in multiple places, you may want to consider making it a constant within the class

Comment on lines 4 to 5
static final int commandLength = 2;
static final int indexOfIndex = 1;

Choose a reason for hiding this comment

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

As these 2 variables are final, should consider probably fully capitalising them like COMMAND_LENGTH for example.

static final int commandLength = 2;
static final int indexOfIndex = 1;

private Task taskToDeleted;

Choose a reason for hiding this comment

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

taskToDeleted sounds grammatically incorrect. Maybe you meant taskToDelete or taskToBeDeleted.

Comment on lines 5 to 7
protected LocalDate from;
static DateTimeFormatter format = DateTimeFormatter.ofPattern("MMM d yyyy");
protected LocalDate to;

Choose a reason for hiding this comment

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

you may want to consider rearranging the order, perhaps static variables together and non static ones together.


@Override
public String toString() {
return "[E]" + super.toString() + " (from: " + from.format(format) + " to: " + to.format(format) + ")";

Choose a reason for hiding this comment

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

Same thing, you might want to abstract out the status icon

Comment on lines 13 to 14
int index = Integer.parseInt(tokens.get(1));
markIndex = index;

Choose a reason for hiding this comment

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

Why not just directly assign?

Comment on lines 9 to 10
}
private static ArrayList<String> tokenize(String input) {

Choose a reason for hiding this comment

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

Since you have been putting a newline between every function so far, might be good to keep consistent and put newline between functions here as well.

Comment on lines 22 to 23
switch (key) {
case "bye":

Choose a reason for hiding this comment

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

According to the java styles, the switch and case should be in the same indentation.

this.isDone = false;
}

}

Choose a reason for hiding this comment

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

May want to add new line to the end of your file

szejiancheng and others added 30 commits February 7, 2023 14:20
# Conflicts:
#	src/main/java/duke/components/Storage.java
Also refactored code to make more sense now that we've removed the Ui class.
Code does not fully follow the specified code style, negatively impacting its readability

Amending all checkstyle violations improves the code quality.

In order to improve code quality, lets resolve all checkstyle violations. This will improve readability as well as ease of documentation.
Add assertions to component classes
Previously the application did not exit properly when the bye command was invoked, which was not expected behaviour

By invoking System.exit(), the command behaves as expected
If a user wants to directly see what tasks they have upcoming, there is no current functionality to sort tasks by date, or completion status.

By adding a remind command, the user is able to get a glance of their upcoming uncompleted tasks within a timeframe they desire (in days)

In our push for optimal user experience, lets add this functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants