Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Latest commit

 

History

History
114 lines (78 loc) · 4.65 KB

CONTRIBUTING.md

File metadata and controls

114 lines (78 loc) · 4.65 KB

Contribution Guidelines

Introduction

This document explains how to contribute to the CaBr2 project.

You can contribute in many different ways, not only by providing code. We need your help translating CaBr2 or our website into other languages (see Translation). If you're an artist you can also help us by creating logos, background images or stickers (see https://codeberg.org/Calciumdibromid/CaBr2_icon).

You're also welcome to talk to us about any other ideas in our Matrix channel.

Translation

We do all translation work using Weblate. The only translation that is maintained in this git repository is en_us.json and is synced automatically by Weblate. Once we decide a translation has reached A SATISFACTORY PERCENTAGE it will be synced back into this repo and included in the next released version.

Software Setup

We are primarily using VSCodium as our IDE for Rust and Angular. VSCodium is an FOSS alternative to VSCode, with all proprietary stuff, like telemetry, removed.

It is advisable to install the following extensions:

For the software setup that is required have a look at these READMEs:

You can also use IntelliJ with the IntelliJ-Rust plugin, but we don't know how well this works and can't provide any support.

Building

For detailed instructions on how to build the different parts of this project see the related READMEs:

Testing

Before submitting a pull request, run all the tests for the whole tree to make sure your changes don't cause regression elsewhere.

Here's how to run the test suite:

  • code lint
yarn lint lint frontend code
yarn prettier -c src check if frontend files are formatted correctly
cargo lint lint Rust files (must be called in a Rust source folder)
cargo fmt --check check if Rust files are formatted correctly (must be called in a Rust source folder)
  • run tests
yarn test test frontend
cargo test test Rust crate

For more information read the README in the folder of the specific component you are working on.

Frontend/Angular

  • all frontend-related code is in src folder
  • imports should be arranged like this with empty lines in between:
    1. external libraries/browser builtins
    2. own modules
  • imports should be sorted alphabetically
  • use style defined in prettierrc:
    • always use trailing commas
    • use single quotes
    • use 2 spaces to indent code
    • ...

Backend/Rust

  • imports should be arranged like this with empty lines in between:
    1. standard library (std)
    2. external libraries
    3. internal libraries (prefixed with cabr2_)
    4. intra-library imports
  • use style defined in rustfmt.toml:
    • always use trailing commas
    • use 2 spaces to indent code
    • ...

Release Cycle

Before v1.0 there will be a release if needed. After v1.0 one release every 6 months (bugfixes excluded).

We use semantic versioning.