Thank you for your interest in contributing to mydocs! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Submitting Changes
- Code Style
- Project Structure
By participating in this project, you agree to abide by our Code of Conduct:
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Respect differing viewpoints and experiences
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/mydocs.git cd mydocs - Add the upstream remote:
git remote add upstream https://github.com/nkostic/mydocs.git
- Go 1.21+ - Download & Install Go
- Make - For running build tasks
- Git - For version control
-
Install dependencies:
go mod tidy
-
Build the application:
make build
-
Install globally (optional):
make install-global
This allows you to use
mydocsfrom anywhere instead of./mydocs. -
Run tests:
make test -
Check code quality:
make lint make vet make fmt
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following our Code Standards
-
Write or update tests for your changes
-
Test your changes:
make test make bench -
Ensure code quality:
make lint make fmt make vet
We use comprehensive testing practices:
- Unit tests: Test individual functions
- Table-driven tests: Test multiple scenarios
- Benchmarks: Performance testing
- Integration tests: Test component interactions
# Run all tests
make test
# Run tests with coverage
go test -cover ./...
# Run benchmarks
make bench
# Run specific test
go test -run TestCreateEntry ./internalFollow our testing patterns:
func TestYourFunction(t *testing.T) {
tests := []struct {
name string
input string
want string
wantErr bool
}{
{"valid case", "input", "expected", false},
{"error case", "bad", "", true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := YourFunction(tt.input)
if (err != nil) != tt.wantErr {
t.Errorf("got error = %v, wantErr %v", err, tt.wantErr)
return
}
if got != tt.want {
t.Errorf("got = %v, want %v", got, tt.want)
}
})
}
}-
Commit your changes:
git add . git commit -m "feat: add new feature description"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- Clear title and description
- Reference any related issues
- Include screenshots if UI changes
- Ensure CI passes
We follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
We follow strict code standards defined in docs/CODE_STANDARDS.MD:
- Use
gofmtfor formatting - Follow Go idioms and best practices
- Use meaningful variable and function names
- Include doc comments for exported functions
- Handle errors appropriately
- Use
charmbracelet/lipglossfor styling - Maintain consistent color scheme
- Provide clear visual feedback
- Use emojis appropriately for UX
// CreateEntry creates a new journal entry for the specified date.
// If date is empty, uses today's date.
func CreateEntry(date string) error {
var targetDate time.Time
var err error
if date == "" {
targetDate = time.Now()
} else {
targetDate, err = time.Parse("2006-01-02", date)
if err != nil {
return fmt.Errorf("invalid date format. Please use YYYY-MM-DD format")
}
}
// ... rest of implementation
}mydocs/
├── cmd/mydocs/ # Application entry point
│ └── main.go
├── internal/ # Core application logic
│ ├── create.go # Journal creation
│ ├── publish.go # Home publishing
│ ├── styles.go # Terminal styling
│ └── version.go # Version information
├── docs/ # Documentation
│ ├── CODE_STANDARDS.MD
│ └── INSTRUCTIONS.MD
├── .editorconfig # Editor configuration
├── .gitignore # Git ignore rules
├── CONTRIBUTING.md # This file
├── LICENSE # MIT License
├── Makefile # Build automation
├── README.md # Project overview
└── go.mod # Go module definition
When reporting issues, please include:
- Description: Clear description of the problem
- Steps to reproduce: Exact steps to trigger the issue
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Environment: OS, Go version, etc.
- Logs: Any relevant error messages
We welcome feature requests! Please:
- Check existing issues first
- Provide clear use case
- Explain expected behavior
- Consider implementation impact
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Email: [contact info if available]
Contributors will be recognized in:
- GitHub contributors list
- Release notes for significant contributions
- Special thanks in README for major features
Thank you for contributing to mydocs! 🙏