Skip to content

Commit e2aaffa

Browse files
committed
docs: add contributing guide
1 parent e310945 commit e2aaffa

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

CONTRIBUTING.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Contributing to GitLab Sync
2+
3+
Thank you for considering contributing to GitLab Sync! We welcome contributions from the community. Here are some guidelines to help you get started.
4+
5+
## Prerequisites
6+
7+
Before contributing, please ensure you have the following prerequisites:
8+
9+
1. Clone the repository: `git clone https://github.com/boxboxjason/gitlab-sync.git`
10+
2. Install [Go](https://golang.org/doc/install) (see [go.mod](./go.mod) for the required version).
11+
3. Install [Make](https://www.gnu.org/software/make/) (if not already installed).
12+
4. Install [golangci-lint](https://golangci-lint.run/) and [gosec](https://github.com/securego/gosec) for static analysis and security checks.
13+
5. Install [gotestsum](https://github.com/gotestyourself/gotestsum) to format test results.
14+
6. Optional: Install [dependency-check](https://owasp.org/www-project-dependency-check/) for dependency vulnerability checks.
15+
7. Optional: Install [Docker](https://www.docker.com/) or [Podman](https://podman.io/) for building the Docker image.
16+
17+
## Development Workflow
18+
19+
1. **Create a new branch** for your changes: `git checkout -b feature/my-feature`
20+
2. **Make your changes** and ensure they are well-tested.
21+
3. **Run the tests** to ensure everything is working correctly: `make test`
22+
4. **Run the linter** to check for code quality: `make lint`
23+
5. **Run security checks** to ensure there are no vulnerabilities: `make dependency-check`
24+
6. Submit a **pull request** with a clear description of your changes and why they are needed.
25+
26+
## Code Style
27+
28+
We follow the standard Go code style. Please ensure your code adheres to the following:
29+
30+
- Use `gofmt` to format your code.
31+
- Use meaningful variable and function names.
32+
- Write clear and concise comments where necessary.
33+
- Ensure your code is well-tested with unit tests.
34+
- Avoid unnecessary complexity; keep your code simple and readable.
35+
- Use `golangci-lint` to check for common issues and code smells.
36+
- Use `gosec` to check for security issues in your code.
37+
- Use `gotestsum` to format test results for better readability.
38+
- Use `dependency-check` to check for known vulnerabilities in your dependencies.

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
![gitlab-sync logo](./assets/gitlab-sync.png)
44

5-
[![Coverage](https://codecov.io/gh/boxboxjason/gitlab-sync/branch/main/graph/badge.svg)](https://codecov.io/gh/boxboxjason/gitlab-sync)
5+
![Coverage](https://sonarqube.boxboxjason.dev/api/project_badges/measure?project=gitlab-sync&metric=coverage&token=sqb_d6468715387db0c98009b78dd80c936893d1e680)
6+
![Lines of Code](https://sonarqube.boxboxjason.dev/api/project_badges/measure?project=gitlab-sync&metric=ncloc&token=sqb_d6468715387db0c98009b78dd80c936893d1e680)
67
![Go Version](https://img.shields.io/github/go-mod/go-version/boxboxjason/gitlab-sync)
78
[![Latest Release](https://img.shields.io/github/v/release/boxboxjason/gitlab-sync)](https://github.com/boxboxjason/gitlab-sync/releases)
89
![Last Commit](https://img.shields.io/github/last-commit/boxboxjason/gitlab-sync)
9-
[![Tests](https://github.com/boxboxjason/gitlab-sync/actions/workflows/go.yml/badge.svg)](https://github.com/boxboxjason/gitlab-sync/actions/workflows/go.yml)
1010
![Contributors](https://img.shields.io/github/contributors/boxboxjason/gitlab-sync?style=social)
1111

1212
(golang) CLI tool to synchronize GitLab projects and groups between two GitLab instances.
@@ -78,7 +78,7 @@ If mandatory arguments are not provided, the program will prompt for them.
7878
| `--retry` or `-r` | N/A | No | Number of retries for failed GitLab API requests (default: 3) |
7979
| `--log-file` | `GITLAB_SYNC_LOG_FILE` | No | Path to a log file for output logs (default: `none`, only outputs logs to stderr) |
8080

81-
## Example
81+
### Example
8282

8383
```bash
8484
gitlab-sync \
@@ -89,7 +89,7 @@ gitlab-sync \
8989
--mirror-mapping /path/to/mirror.json
9090
```
9191

92-
## JSON Mapping File
92+
### JSON Mapping File
9393

9494
The JSON mapping file is used to define the projects and groups to be synchronized between the two GitLab instances. You also define the copy options for each project / group.
9595

@@ -132,3 +132,7 @@ Also, the destination namespace must exist on the destination GitLab instance. I
132132
}
133133
}
134134
```
135+
136+
## Development
137+
138+
Check the [CONTRIBUTING.md](./CONTRIBUTING.md) file for guidelines on how to contribute to this project.

0 commit comments

Comments
 (0)