• Stars
    star
    192
  • Rank 202,019 (Top 4 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Exercism exercises in Kotlin.

Exercism Kotlin Track

Build Status

Source for Exercism Exercises in Kotlin.

Contributing Guide

For general information about how to contribute to Exercism, please refer to the contributing guide.

Table of Contents

Overview

This guide covers contributing to the Kotlin track. If you are new, this guide is for you.

If, at any point, you're having any trouble, pop in the Building Exercism category of the Exercism forum for help.

Contributing With Minimal Setup

First things first: by contributing to Exercism, you are making this learning tool that much better and improving our industry as a whole... thank you!!!

To submit a fix for an existing exercise or port an exercise to Kotlin with the least amount of setup:

  1. Ensure you have the basic Java tooling installed: JDK 1.8+, an editor and Gradle 2.x.

    (see exercism.io: Installing Kotlin)

Next steps:

  • "fork" a repository on GitHub;
  • install git;

  • "clone" a copy of your fork;

  • configure an "upstream remote" (in this case, exercism/kotlin);

  • create a branch to house your work

  • Write the codes. Do your work on that branch you just created.

    The Getting Familiar With the Codebase section, below, is an orientation.

  • Commit, push and create a pull request.

    Something like:

    $ git add .
    $ git commit -m "(An intention-revealing commit message)"
    $ git push
    

    It is advised you write meaningful commit messages. Chris Beams wrote about "How to Write a Git Commit Message".

  • Verify that your work passes all tests. When you create a pull request (PR), GitHub triggers a build on Travis CI. Your PR will not be merged unless those tests pass.

Getting Familiar With the Codebase

There are two objectives to the design of this build:

  1. when a problem is built from within the exercism/kotlin repo (i.e. when you, the contributor, are developing the exercise), the tests run against the reference solution;
  2. when a problem is built outside the exercism/kotlin repo (when a participant is solving the exercise), the tests run against the "main" code.

This repo is a multi-project gradle build.

The exercises Module

This is the top-level module, contained in the exercises directory. It is a container for the problem sub-modules.

  • its build.gradle points the "main" sourceset to the reference solution.
  • its settings.gradle names each of the subprojects, one for each problem in the set.

The Problem Submodules

The exercises subdirectory contains all of the problem submodules. Each problem/submodule is a subdirectory of the same name as its slug.

  • its build.gradle.kts names dependencies required to work that problem.

Each problem/submodule has three source sets:

  • src/test/kotlin/ β€” a test suite defining the edges of the problem
  • .meta/src/reference/kotlin/ β€” a reference solution that passes all the tests
  • src/main/kotlin/ β€” starter source files, if required/desired (this directory usually only has a .keep file in it).

To run the tests for a specific exercise, run the test Gradle task from the exercises directory. For example:

cd exercises
https://github.com/exercism/v3/blob/main/gradlew bob:test

Steps for modifying an exercise:

  1. Change the test(s).
  2. Watch the changes fail.
  3. Update the reference solution to make the test(s) pass.

Advanced: Complete Local Setup

If you are going to make significant contribution(s) to the track, you might find it handy to have a complete local install of exercism on your computer. This way, you can run the full suite of tests without having to create/update a PR.

The easiest way to achieve this is simply use the bin/journey-test.sh script. However, you may want to perform other tests, depending on what you are doing. You can do so by duplicating the setup performed by the bin/journey-test.sh script.

Tip: gradle clean before exercism fetch

If you exercism fetch after doing a build, the CLI will fail with the following error message:

$ exercism fetch kotlin bob
2015/09/06 15:03:21 an internal server error was received.
Please file a bug report with the contents of 'exercism debug' at: https://github.com/exercism/exercism.io/issues

and if you review the logs of your x-api, you'll find:

127.0.0.1 - - [06/Sep/2015:15:20:56 -0700] "GET /v2/exercises/kotlin/bob HTTP/1.1" 500 514949 0.2138
2015-09-06 15:21:01 - JSON::GeneratorError - source sequence is illegal/malformed utf-8:

This is because some files generated by the build can't be served from the x-api. This is by design: the CLI does not serve binaries. To fix this, simply make sure you do a clean in your exercism/kotlin repo before you fetch:

cd ~/workspace/exercism/kotlin/exercises
gradle clean
cd ~/workspace/exercism/exercises
exercism fetch kotlin bob

More Repositories

1

exercism

Crowd-sourced code mentorship. Practice having thoughtful conversations about code.
7,312
star
2

python

Exercism exercises in Python.
Python
1,863
star
3

cli

A Go based command line tool for exercism.org.
Go
1,267
star
4

rust

Exercism exercises in Rust.
Rust
1,191
star
5

go

Exercism exercises in Go.
Go
986
star
6

java

Exercism exercises in Java.
Java
686
star
7

elixir

Exercism exercises in Elixir.
Elixir
570
star
8

javascript

Exercism exercises in JavaScript.
JavaScript
560
star
9

ruby

Exercism exercises in Ruby.
Ruby
498
star
10

haskell

Exercism exercises in Haskell.
Haskell
450
star
11

website

The codebase for Exercism's website.
Ruby
405
star
12

problem-specifications

Shared metadata for exercism exercises.
Ruby
310
star
13

csharp

Exercism exercises in C#.
C#
276
star
14

c

Exercism exercises in C.
C
249
star
15

cpp

Exercism exercises in C++.
C++
226
star
16

website-copy

A repository for exercism's website's copy
HTML
198
star
17

DEPRECATED.javascript

Exercism exercises in JavaScript.
JavaScript
194
star
18

windows-installer

A project to download and install the latest version of Exercism Client for Windows depending on the architecture.
Pascal
190
star
19

v3

The work-in-progress project for developing v3 tracks
C#
170
star
20

typescript

Exercism exercises in TypeScript.
JavaScript
145
star
21

clojure

Exercism exercises in Clojure.
Clojure
144
star
22

php

Exercism exercises in PHP.
PHP
129
star
23

elm

Exercism exercises in Elm.
Elm
129
star
24

v2-website

Exercism β€” Code practice and mentorship for everyone.
Ruby
125
star
25

erlang

Exercism exercises in Erlang.
Erlang
124
star
26

scala

Exercism exercises in Scala.
Scala
115
star
27

fsharp

Exercism exercises in F#.
F#
106
star
28

swift

Exercism exercises in Swift.
Swift
101
star
29

bash

Exercism exercises in Bash.
Shell
92
star
30

ocaml

Exercism exercises in OCaml.
OCaml
91
star
31

legacy-docs

84
star
32

gleam

Exercism exercises in Gleam.
Gleam
81
star
33

common-lisp

Exercism exercises in Common Lisp.
Common Lisp
76
star
34

crystal

Exercism exercises in Crystal.
Crystal
70
star
35

abap

Exercism exercises in ABAP.
ABAP
63
star
36

julia

Exercism exercises in Julia.
Julia
61
star
37

nim

Exercism exercises in Nim.
Nim
51
star
38

dart

Exercism exercises in Dart.
Dart
50
star
39

DEPRECATED.exercism.rb

DEPRECATED. See http://github.com/exercism/cli for the new CLI.
Ruby
48
star
40

DEPRECATED.x-api

Application to serve exercism assignments
Ruby
46
star
41

emacs-lisp

Exercism exercises in Emacs Lisp.
Emacs Lisp
45
star
42

docs

Exercism's docs. View them at Exercism's website, not on GitHub.
42
star
43

racket

Exercism exercises in Racket.
Racket
39
star
44

zig

Exercism exercises in Zig.
Zig
38
star
45

pony

Exercism exercises in Pony.
Pony
38
star
46

discussions

For discussing things like future features, roadmap, priorities, and other things that are not directly action-oriented (yet).
37
star
47

powershell

Exercism exercises in Windows PowerShell.
PowerShell
35
star
48

scheme

Exercism exercises in Scheme.
Scheme
35
star
49

purescript

Exercism exercises in PureScript.
PureScript
35
star
50

hiring-frontend-developer

34
star
51

pr-commenter-action

The PR Commenter GitHub action posts comments on a PR that can vary depending on which files are being changed in the PR.
JavaScript
33
star
52

lua

Exercism exercises in Lua.
Lua
33
star
53

pharo-smalltalk

Exercism exercises in Pharo.
Smalltalk
33
star
54

delphi

Exercism exercises in Delphi Pascal.
Pascal
33
star
55

exalysis

Mentoring tool for the Go track on Exercism. Downloads students code, checks it and provides suggestions.
Go
33
star
56

DEPRECATED.rikki

A worker written in golang for automatically nitpicking exercism submissions.
Go
30
star
57

idris

Exercism exercises in Idris.
Idris
29
star
58

plsql

Exercism exercises in PL/SQL.
PLSQL
28
star
59

prolog

Exercism exercises in Prolog.
Prolog
27
star
60

elixir-analyzer

Elixir
27
star
61

perl5

Exercism exercises in Perl 5.
Perl
26
star
62

automated-analysis

An overview space for Automated Analysis on Exercism
26
star
63

sml

Exercism exercises in Standard ML.
Standard ML
24
star
64

lfe

Exercism exercises in Lisp Flavoured Erlang (LFE).
LFE
23
star
65

r

Exercism exercises in R.
R
23
star
66

gui

JavaScript
22
star
67

deprecated-mentors

Rust
22
star
68

fortran

Exercism exercises in Fortran.
Fortran
22
star
69

x86-64-assembly

Exercism exercises in x86-64 Assembly.
Assembly
22
star
70

raku

Exercism exercises in Raku
Raku
22
star
71

blog

Exercism's blog content
Shell
21
star
72

configlet

The official tool for managing Exercism language track repositories.
Nim
20
star
73

reasonml

Exercism exercises in ReasonML.
Reason
20
star
74

groovy

Exercism exercises in Groovy.
Groovy
19
star
75

red

Exercism exercises in Red.
Red
19
star
76

mips

Exercism exercises in MIPS Assembly.
Shell
19
star
77

vimscript

Exercism exercises in Vim script.
Vim Script
18
star
78

generic-track

Ruby
18
star
79

coq

Exercism exercises in Coq.
Shell
17
star
80

nix

Exercism exercises in Nix.
Shell
17
star
81

terraform

HCL
17
star
82

DEPRECATED.help.exercism.io

DEPRECATED. LEGACY. NO LONGER BEING WORKED ON.
JavaScript
17
star
83

d

Exercism exercises in D.
D
16
star
84

v2-configlet

Tool to assist in managing Exercism language tracks.
Go
16
star
85

coffeescript

Exercism exercises in CoffeeScript.
CoffeeScript
16
star
86

development-environment

Ruby
16
star
87

solidity

Exercism exercises in Solidity.
JavaScript
15
star
88

babashka

Exercism exercises in Babashka.
Clojure
14
star
89

javascript-analyzer

This is Exercism's automated analyzer for the JavaScript track.
TypeScript
14
star
90

interactive-cli-walkthrough

Ruby
13
star
91

DEPRECATED.v2-feedback

Please use https://github.com/exercism/exercism.io for reporting issues
13
star
92

ruby-analyzer

This is Exercism's automated analyzer for the Ruby track.
Ruby
13
star
93

csharp-analyzer

An analyser for C#
C#
12
star
94

cfml

Exercism exercises in CFML.
ColdFusion
12
star
95

gnu-apl

Exercism exercises in GNU APL.
APL
12
star
96

v3-beta

12
star
97

awk

Exercism exercises in AWK.
Shell
12
star
98

tracks-maintenance-dashboard

A dashboard for maintainers to understand the state of tracks
TypeScript
11
star
99

python-test-runner

Python
11
star
100

go-test-runner

Jupyter Notebook
11
star