Skip to content

Commit

Permalink
Update CONTRIBUTING.md (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
elronbandel committed May 23, 2024
1 parent 226865b commit 39d4cd2
Showing 1 changed file with 46 additions and 49 deletions.
95 changes: 46 additions & 49 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,55 @@
## Accessing the project
First clone the project:

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

Then, navigate to the project directory:

```bash
cd unitxt
```
```bash
cd unitxt
```

## Setting up the project
First, create a virtual environment:

```bash
python -m venv unitxt-venv
```
```bash
python -m venv unitxt-venv
```

Then, activate the virtual environment:

```bash
source unitxt-venv/bin/activate
```
```bash
source unitxt-venv/bin/activate
```

Then, install the project:

```bash
pip install -e ".[dev]"
```
```bash
pip install -e ".[dev]"
```

## Running pre-commit before committing

First, install the pre-commit hooks:

```bash
pre-commit install
```
```bash
pre-commit install
```

To run pre-commit before committing:

```bash
pre-commit run --all-files
```
```bash
pre-commit run --all-files
```

Or simply run:

```bash
make pre-commit
```
```bash
make pre-commit
```

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

The pre-commit hooks will:
Expand All @@ -60,37 +66,27 @@ The pre-commit hooks will:

First, install the project with the test dependencies:

```bash
pip install -e ".[tests]"
```
```bash
pip install -e ".[tests]"
```
To run a specific test:

```bash
python -m unittest tests.test_<module>
```
```bash
python -m unittest tests.test_<module>
```

To run all the tests:

```bash
python -m unittest
```
```bash
python -m unittest
```
Bef

# Repo principles:

## Git

### Pull
Always pull --rebase before pushing:

```bash
git pull --rebase
```
If you have local changes you want to stash:

```bash
git pull --rebase --autostash
```
### Merge your PR to main
Use squash and merge to merge your PR to main.

Expand All @@ -99,17 +95,18 @@ Always commit with a [good commit message](https://cbea.ms/git-commit/) and sign

Example:

```bash
git commit -s
```
```bash
git commit -s
```

### Push
Push into a new branch and open a PR.

Example:

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


## Structure
Expand Down

0 comments on commit 39d4cd2

Please sign in to comment.