Skip to content

Commit

Permalink
Adding analyzer feedback for booking-up-for-beauty concept exercise (
Browse files Browse the repository at this point in the history
…#2753)

* Adding analyzer feedback for  concept exercise

* Updating comments to actionables instead of essentials

* Adding other compliant method to the haspassed comment
  • Loading branch information
manumafe98 authored Apr 2, 2024
1 parent 9dca37e commit 951a406
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 16 additions & 0 deletions exercises/concept/booking-up-for-beauty/.meta/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,19 @@

- `strings`: know how to use string formatting.
- `numbers`: know how to apply basic mathematical operators.

## Analyzer

This exercise could benefit from the following rules in the [analyzer]:

- `actionable`: If the student did not use `ofPattern` and `parse` methods in the `schedule` method, instruct the student to do so.
- `actionable`: If the student did not use `isBefore` or `compareTo` methods in the `hasPassed` method, instruct the student to do so.
- `actionable`: If the student did not use `getHour` in the `isAfternoonAppointment` method, instruct the student to do so.
- `actionable`: If the student did not use `ofPattern` and `DateTimeFormatter.format` methods in the `getDescription` method, instruct the student to do so.
- `actionable`: If the student did not use `getYear` in the `getAnniversaryDate` method, instruct the student to do so.
- `informative`: If the solution uses `String.format` in the `getDescription` method, inform the student that this cause a small performance penalty compared to string concatenation.

If the solution does not receive any of the above feedback, it must be exemplar.
Leave a `celebratory` comment to celebrate the success!

[analyzer]: https://github.com/exercism/java-analyzer
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

class AppointmentScheduler {

private static final LocalDate OPENING_DATE = LocalDate.of(2015, Month.SEPTEMBER, 15);

public LocalDateTime schedule(String appointmentDateDescription) {
var formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss", Locale.ENGLISH);
return LocalDateTime.parse(appointmentDateDescription, formatter);
Expand All @@ -27,6 +25,6 @@ public String getDescription(LocalDateTime appointmentDate) {
}

public LocalDate getAnniversaryDate() {
return OPENING_DATE.withYear(LocalDate.now().getYear());
return LocalDate.of(LocalDate.now().getYear(), Month.SEPTEMBER, 15);
}
}

0 comments on commit 951a406

Please sign in to comment.