Giter Site home page Giter Site logo

sarvex / exercism-ballerina Goto Github PK

View Code? Open in Web Editor NEW

This project forked from exercism/ballerina

0.0 1.0 0.0 268 KB

Exercism exercises in Ballerina.

Home Page: https://exercism.org/tracks/ballerina

License: MIT License

Shell 2.63% Ballerina 97.37%

exercism-ballerina's Introduction

Exercism Ballerina Track

[Configlet Status] [Exercise Test Status]

Exercism exercises in Ballerina. Ballerina is a compiled, transactional, statically and strongly typed programming language with textual and graphical syntaxes. Ballerina incorporates fundamental concepts of distributed system integration into the language and offers a type-safe, concurrent environment to implement microservices with distributed transactions, reliable messaging, stream processing, and workflows.

Setup

You can install Ballerina by following the Ballerina installation guide.

Contributing

Thank you so much for contributing! ๐ŸŽ‰

Please read about how to get involved in a track. Be sure to read the Exercism Code of Conduct.

We welcome pull requests of all kinds. No contribution is too small.

We encourage contributions that provide fixes and improvements to existing exercises. Please note that this track's exercises must conform to the Exercism-wide standards described in the documentation. If you're unsure about how to make a change, then go ahead and open a GitHub issue, and we'll discuss it.

Exercise Tests

At the most basic level, Exercism is all about the tests. You can read more about how we think about test suites in the Exercism documentation.

Test files should use the following format:

import ballerina/test;

// This is the mock function which will replace the real function
string[] outputs = [];

// This is the mock function which will replace the real function
@test:Mock {
    moduleName: "ballerina/io",
    functionName: "println"
}
test:MockFunction mock_printLn = new ();

public function mockPrint(any... val) {
    outputs.push(val.reduce(function(any a, any b) returns string => a.toString() + b.toString(), "").toString());
}

@test:Config
function testFunc() {
    test:when(mock_printLn).call("mockPrint");
    // Invoking the main function
    main();
    test:assertEquals(outputs[0], "Hello, World!");
}

Opening an Issue

If you plan to make significant or breaking changes, please open an issue so we can discuss it first. If this is a discussion that is relevant to more than just the Ballerina track, please open an issue in exercism/discussions.

Submitting a Pull Request

Pull requests should be focused on a single exercise, issue, or conceptually cohesive change. Please refer to Exercism's pull request guidelines.

Please follow the coding standards for Ballerina. (If there is a formatter for the track's language, add instructions for using it here.)

Verifying Your Change

Before submitting your pull request, you'll want to verify the changes in two ways:

  • Run all the tests for the Ballerina exercises
  • Run an Exercism-specific linter to verify the track

All the tests for Ballerina exercises can be run from the top level of the repo with

sh run_ballerina_tests.sh

For the Exercism-specific linting, please see the documentation.

Contributing a New Exercise

Please see the documentation about adding new exercises.

Note that:

  • Each exercise must stand on its own. Do not reference files outside the exercise directory. They will not be included when the user fetches the exercise.
  • Exercises should use only the Ballerina core libraries.
  • Exercises must conform to the Exercism-wide standards described in the documentation.
  • Each exercise should have a test suite, an example solution, a template file for the real implementation and ... (anything else that needs to go with each exercise for this track). The CI build expects files to be named using the following convention: (describe the Ballerina convention for naming the various files that make up an exercise).
  • Please do not commit any configuration files or directories inside the exercise other than ...
  • Be sure to add it to the appropriate place in the config.json file.

Quick Reference:

  • Create an exercise under ballerina-exercism/exercsises/<exercise-name>
  • Add the full reference implementation to <exercise-name>/.meta/reference .
  • Add the exercise skeleton(incomplete solution) to <exercise-name>/.
  • Add all test cases under <exercise-name>test/ .
  • Run all tests using : .https://github.com/exercism/v3/blob/main/ballerina-exercism/exercises$ sh run_ballerina_tests.sh and make sure all tests are passed.
  • Add exercise to ballerina-exercism/config.json.
  • Generate an UUID using configlet uuid use that as the ID for the exercise.
  • Update config.json with the metadata for the new exercise.
  • Run linter : configlet lint . --track-id=ballerina and make sure you don't have any issues.
  • Now you are ready to commit and push the exercise.
  • Once changes are pushed, create a PR.

exercism-ballerina's People

Contributors

cmccandless avatar connorads avatar dependabot[bot] avatar devchamploo avatar erikschierboom avatar exercism-bot avatar hemikak avatar houhoulis avatar ihid avatar jackhughesweb avatar kasun04 avatar katrinleinweber avatar kytrinyx avatar lafernando avatar ldclakmal avatar manuri avatar praneesha avatar son1112 avatar vinok88 avatar vordimous avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.