Skip to content

Commit

Permalink
Merge pull request #934 from hexlet-codebattle/trigger-deploy
Browse files Browse the repository at this point in the history
Trigger deploy
  • Loading branch information
vtm9 committed May 19, 2022
2 parents 924e51d + 384740c commit 487a54c
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![Hexlet chat](http://slack-ru.hexlet.io/badge.svg)](http://slack-ru.hexlet.io)

## Setup for development

- Install [clojure.](https://clojure.org/guides/getting_started)

## Contributing
Expand All @@ -19,8 +20,11 @@
11. Wait, until PR is reviewed

## How to add a new issue

### 1. Write the description of the issue with function signature and test-data

A description of the issue includes:

- `level` — difficulty of the problem; possible values are `elementary`, `easy`, `medium`, `hard`.
- `description` — detailed description of the issue. Now supported laguages is `ru` and `en`, `en` is required. You can run `make check-translations` for list current translation progress.
- `tags` — tags that provides addittional info about task, array of strings.
Expand All @@ -29,14 +33,15 @@ A description of the issue includes:
- `test-data` — data in a specified format which will be used to test solutions. The first element in this list will be displayed as an example to players, so it should clarify and illustrate the problem as much as possible. Do not choose a trivial case for this example.

Example:

```clojure
(ns battle-asserts.issues.array_sum)

(def level :elementary)

(def tags ["training" "collections"])

(def description
(def description
{:en "Calculate the sum of array." :ru "Рассчитайте сумму всех чисел в массиве."})

(def signature
Expand All @@ -48,22 +53,26 @@ Example:
{:expected 0 :arguments [[]]}
{:expected 10 :arguments [[1 2 3 4]]}])
```

See examples in `src/battle_asserts/issues/*.clj`

### 2. Write the implementation of the issue and test

An implementation of the issue includes:

- `arguments-generator` — arguments generator for the `solution` function;
generated arguments will be used to test players' solutions.
- `solution` — implemented correct solution.
Example:
Example:

```clojure
(ns battle-asserts.issues.array_sum)

(def level :elementary)

(def tags ["training" "collections"])

(def description
(def description
{:en "Calculate the sum of array." :ru "Рассчитайте сумму всех чисел в массиве."})

(def signature
Expand All @@ -81,7 +90,9 @@ Example:
(defn solution [numbers]
(apply + numbers))
```
Corresponding tests are in `test/test_helper.clj` there is no need to add tests to this file, because tests runs dynamically, depending on the described `signature`, `test-data`, `arguments-generator` and `solution`.

Corresponding tests are in `test/test_helper.clj` there is no need to add tests to this file, because tests runs dynamically, depending on the described `signature`, `test-data`, `arguments-generator` and `solution`.

- `run-solution-spec-test` tests are checking that result type of solving issue is correct.
- `run-generator-spec-test` tests are checking that input signatures are correctly described for `arguments-generator`.
- `run-solution-test` tests are checking that test data solves correctly.
Expand All @@ -90,9 +101,11 @@ Corresponding tests are in `test/test_helper.clj` there is no need to add tests
- `run-difficulty-test` tests are checking that issue has correct difficulty level.

### 3. Create pull-request

It will appear with auto-generated asserts on [codebattle](http://codebattle.hexlet.io) after merge .

### Useful commands

- `make check-translations` check current tasks translation progress.
- `make check-tags` check current tasks tagging progress.
- `make check-generators-and-solutions` check current tasks solution and arguments-generator progress.
Expand All @@ -102,10 +115,12 @@ It will appear with auto-generated asserts on [codebattle](http://codebattle.hex
## Related links

### Clojure

- https://clojure.org/index
- https://clojure.org/guides/getting_started
- https://ru.code-basics.com/languages/clojure (currently, only in russian)

### Better clojure dev experience

- https://www.gnu.org/software/emacs/ or https://www.spacemacs.org/
- https://clojure.org/guides/repl/annex_community_resources

0 comments on commit 487a54c

Please sign in to comment.