Thank you for your interest in contributing to csv2json! We welcome contributions from the community.
- Code of Conduct
- Getting Started
- Development Setup
- Running Tests
- Making Changes
- Pull Request Process
- Coding Standards
- Reporting Bugs
- Feature Requests
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
- Fork the repository on GitHub
- Clone your fork locally
- Set up the development environment
- Create a new branch for your feature or bugfix
- Make your changes
- Run tests to ensure everything works
- Submit a pull request
- Go 1.25.4 or higher
- PostgreSQL 12 or higher
- Git
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/csv2json.git cd csv2json -
Add upstream remote:
git remote add upstream https://github.com/agileproject-gurpreet/csv2json.git
-
Install dependencies:
go mod download
-
Set up PostgreSQL:
# Create database createdb csv2json_dev # Run setup script psql -d csv2json_dev -f docs/setup.sql
-
Configure environment variables:
cp .env.example .env # Edit .env with your local database credentials -
Run the application:
go run cmd/api/main.go
We maintain comprehensive test coverage for all critical components.
go test ./...go test ./... -covergo test ./... -vgo test ./internal/parser/tests/go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out# Run all tests
go test ./...
# Check formatting
go fmt ./...
# Run go vet
go vet ./...
# Run golint (if installed)
golint ./...feature/description- for new featuresfix/description- for bug fixesdocs/description- for documentation updatesrefactor/description- for code refactoringtest/description- for test improvements
Example: feature/add-xml-support or fix/handle-empty-csv
Follow the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(parser): add support for custom delimiters
fix(api): handle empty CSV files gracefully
docs(readme): update installation instructions
test(parser): add edge case tests for malformed CSV
-
Update your branch:
git fetch upstream git rebase upstream/main
-
Ensure all tests pass:
go test ./... -
Format your code:
go fmt ./...
-
Update documentation if needed (README.md, API docs, etc.)
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- Clear title describing the change
- Detailed description of what changed and why
- Reference any related issues (e.g., "Fixes #123")
- Screenshots or examples if applicable
-
PR Description Template:
## Description Brief description of the changes ## Type of Change - [ ] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Documentation update ## Testing Describe the tests you ran ## Checklist - [ ] My code follows the project's style guidelines - [ ] I have performed a self-review of my code - [ ] I have commented my code where necessary - [ ] I have updated the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix/feature works - [ ] New and existing unit tests pass locally
- At least one maintainer will review your PR
- Address any feedback or requested changes
- Once approved, a maintainer will merge your PR
- Your contribution will be included in the next release!
-
Delete your branch:
git branch -d feature/your-feature-name git push origin --delete feature/your-feature-name
-
Update your main branch:
git checkout main git pull upstream main
- Follow the Effective Go guidelines
- Use
go fmtfor formatting - Keep functions small and focused
- Write clear, self-documenting code
- Use meaningful variable and function names
- Add comments for exported functions and types
csv2json/
├── cmd/ # Application entry points
├── internal/ # Private application code
│ ├── database/ # Database operations
│ ├── handler/ # HTTP handlers
│ ├── parser/ # CSV parsing logic
│ └── service/ # Business logic
├── pkg/ # Public libraries
└── docs/ # Documentation
- Always handle errors explicitly
- Provide meaningful error messages
- Use wrapped errors for context:
fmt.Errorf("operation failed: %w", err)
- Write tests for all new functionality
- Aim for >80% code coverage
- Use table-driven tests where appropriate
- Test edge cases and error conditions
- Check existing issues to avoid duplicates
- Ensure you're using the latest version
- Verify the bug is reproducible
**Describe the bug**
A clear description of the bug
**To Reproduce**
Steps to reproduce:
1.
2.
3.
**Expected behavior**
What you expected to happen
**Actual behavior**
What actually happened
**Environment:**
- OS: [e.g., Windows 11, Ubuntu 22.04]
- Go version: [e.g., 1.25.4]
- PostgreSQL version: [e.g., 14.2]
**Additional context**
Any other relevant informationWe welcome feature requests! Please:
- Check if the feature has already been requested
- Provide a clear use case
- Explain how it benefits the project
- Be open to discussion and feedback
- Open an issue with the
questionlabel - Reach out to the maintainers
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to csv2json! 🎉