Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,106 @@ pytest
```

## 5. Commit and push

Use a clear message:
```bash
git commit -m "Fix: ignore extra spaces in count_words (closes #3)"
git push origin fix-short-description
```

## 6. Open a Pull Request

Fill in the PR template and write `Closes #<issue-number>`. A maintainer will review it, usually within a few days.

## Frequently Asked Questions

### How do I keep my fork up to date?

First, make sure your working tree is clean. Commit or stash any uncommitted changes before switching branches.

If you haven't already added the original repository as a remote, add it once:

```bash
git remote add upstream https://github.com/codepiyusss/open_source_issue_contribution.git
```

Fetch the latest changes from the original repository and merge them into your local `main` branch:

```bash
git fetch upstream
git switch main
git merge upstream/main
git push origin main
```

This updates your fork's `main` branch with the latest changes from the original repository.

### How do I resolve a merge conflict?

Merge conflicts happen when Git cannot automatically combine changes.

1. Run `git status` to identify the conflicted files.
2. Open each conflicted file and look for conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`).
3. Edit the files to keep the correct changes and remove the conflict markers.
4. Stage the resolved files:

```bash
git add <file-name>
```

5. Complete the merge:

```bash
git merge --continue
```

If you want to cancel the merge instead, run `git merge --abort`.

### What should I do if CI fails?

1. Open your pull request on GitHub.
2. Check the failed status checks and open the corresponding logs.
3. Identify the cause of the failure.
4. Reproduce the issue locally where possible and fix it.
5. Run the relevant tests before pushing your changes.

After fixing the issue, stage, commit, and push your changes:

```bash
pytest
git add <file-name>
git commit -m "Fix failing CI checks"
git push origin <your-branch-name>
```

If the failure is unrelated to your changes, check the logs and ask a maintainer for guidance.

### How do I add more changes to an already-open pull request?

You do not need to open another pull request.

1. Switch to the branch associated with your existing pull request:

```bash
git switch <your-branch-name>
```

2. Make your additional changes.
3. Stage and commit them:

```bash
git add <file-name>
git commit -m "Update contribution"
```

4. Push to the same branch:

```bash
git push origin <your-branch-name>
```

GitHub will automatically update your existing pull request with the new commits.

## Style
- Python 3.8+, follow PEP 8.
- Add docstrings to new functions.
Expand Down