Skip to content

Latest commit

 

History

History
133 lines (85 loc) · 3.71 KB

CONTRIBUTING.md

File metadata and controls

133 lines (85 loc) · 3.71 KB

Contributing

Managing dependencies

Poetry

To guarantee repeatable installations, all project dependencies are managed using Poetry. The project’s direct dependencies are listed in pyproject.toml. Running poetry lock generates poetry.lock which has all versions pinned.

You can install Poetry by using pip install --pre poetry or by following the official installation guide here.

If you're using a PyCharm, also install a Poetry Plugin.

Other tools

For compatibility, YaTracker also provides requirements.txt and requirements_dev.txt.

Coding style

YaTracker uses various tools to maintain a common coding style and help with development. To install all the development tools, run the following commands:

python -m pip install -r requirements_dev.txt

or use poetry:

poetry install

Pre-commit

YaTracker uses the pre-commit tool to check and automatically fix any formatting issue before creating a git commit.

Run the following command to install pre-commit into your git hooks and have it run on every commit:

pre-commit install

For more information on how it works, see the .pre-commit-config.yaml configuration file.

Commit naming

YaTracker using Conventional Commits - specification for adding human and machine-readable meaning to commit messages.

The commit message should be structured as follows:

Commit message structure:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Examples:

feat: implemented graceful close
BREAKING CHANGE: close method become async
fix: wrong object type
docs: add profile description

Formatting

YaTracker has a strict formatting policy enforced by the black formatting tool.

Typing

YaTracker has a strict typing policy enforced by the mypy. All functions with static typing must be described with the typing module. For example:

from typing import List


def collect_integers(a: int, b: int) -> List[int]:
    return [a, b]

Linters

  • black to make sure your code is correctly formatted.

  • isort to maintain consistent imports.

  • pylint to catch errors in your code.

  • flake8 to make sure your code adheres to PEP 8.

  • pydocstyle to check that your docstrings are properly formatted.

  • mypy to check that your types correctly assigned and used.

EditorConfig

EditorConfig is a standard configuration file that aims to ensure consistent style across multiple programming environments.

YaTracker’s repository contains an .editorconfig file describing our formatting requirements.

Most editors and IDEs support this file either directly or via plugins. See the list of supported editors and IDEs for detailed instructions.

If you make sure that your programming environment respects the contents of this file, you will automatically get correct indentation, encoding, and line endings.

Changelog

Our changelog is not autogenerated. If you've changed something matters, don't forget to add it to the [Unreleased] section of the Changelog