Skip to content

Latest commit

 

History

History
115 lines (77 loc) · 1.72 KB

CONTRIBUTING.md

File metadata and controls

115 lines (77 loc) · 1.72 KB

Contributing Guide

Accessing the project

First clone the project:

git clone https://github.com/IBM/unitxt.git

Then, navigate to the project directory:

cd unitxt

Setting up the project

First, create a virtual environment:

python -m venv unitxt-venv

Then, activate the virtual environment:

source unitxt-venv/bin/activate

Then, install the project:

pip install -e ".[dev]"

Running pre-commit before committing

First, install the pre-commit hooks:

pre-commit install

To run pre-commit before committing:

pre-commit run --all-files

Or simply run:

make pre-commit

This will run the pre-commit hooks on all files.

The pre-commit hooks will:

  1. Check for any linting errors
  2. Check for any formatting errors
  3. Check for any security vulnerabilities
  4. Check for spelling errors
  5. Verify you used relative imports inside src/ directory
  6. Verify you used library imports outside src/ directory

Running Tests

First, install the project with the test dependencies:

pip install -e ".[tests]"

To run a specific test:

python -m unittest tests.test_<module>

To run all the tests:

python -m unittest

Bef

Repo principles:

Git

Merge your PR to main

Use squash and merge to merge your PR to main.

Commit

Always commit with a good commit message and sign off:

Example:

git commit -s

Push

Push into a new branch and open a PR.

Example:

git push origin main:<my-new-branch-name>

Structure

Layout

The layout of the repo is src layout