Update Yacht exercise config.json to include the second required solution source file

The exercise relies on the Yacht.kt file and this one depends on YachtCategory.kt file (which declares the utility enum class).

As of now, only Yacht.kt is included in the solution files array inside config.json.
This causes the two following errors :

  • HELP.md is not mentioning the correct command to submit the exercise (beginners using the Exercism CLI may not easily understand why tests are passing locally but not on the server) : exercism submit src/main/kotlin/Yacht.kt (currently) instead of exercism submit src/main/kotlin/Yacht.kt src/main/kotlin/YachtCategory.kt (corrected)
  • The shortcut command (exercism submit without any arguments) uses only Yacht.kt instead of passing both files

With the addition of YachtCategory.kt in the solution files, these two issues are fixed.

I’ve opened a GitHub PR which has automatically been rejected (because of not having a topic on this forum) : Update Yacht's config.json to include the second required solution source file by IndiGan · Pull Request #693 · exercism/kotlin · GitHub

2 Likes

Instinctively this seems reasonable to me. Thanks. I’ve reopened the PR. If someone with some kotlin knowledge/authority here could weigh in, that’d be great :slight_smile:

If I may chime it, the category file should be in .files.editor

  "files": {
    "solution": [
      "src/main/kotlin/Yacht.kt"
    ],
    "test": [
      "src/test/kotlin/YachtTest.kt"
    ],
    "example": [
      ".meta/src/reference/kotlin/Yacht.kt"
    ],
    "editor": [
      "src/main/kotlin/YachtCategory.kt"
    ]
  },

This way, the file will be visible in the web editor, but not editable.
And it doesn’t need to be submitted because it doesn’t need to change.

I did the same thing in the perl5 track

1 Like

Won’t this cause some problems when using the CLI?
Because currently, if we don’t publish YachCategory.kt, the tests will always fail

The CLI will download the file because it’s named in the config.

The test runner will also do the right thing.

1 Like

Ok, thanks for these precisions!

I’m changing this in the PR right now

1 Like