|
| 1 | +# Contributing to SwiftGlass |
| 2 | + |
| 3 | +Thank you for your interest in contributing to SwiftGlass! We welcome contributions from everyone, regardless of experience level. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | +- [Code of Conduct](#code-of-conduct) |
| 7 | +- [Getting Started](#getting-started) |
| 8 | +- [Development Setup](#development-setup) |
| 9 | +- [Pull Request Process](#pull-request-process) |
| 10 | +- [Coding Standards](#coding-standards) |
| 11 | +- [Commit Guidelines](#commit-guidelines) |
| 12 | +- [Testing](#testing) |
| 13 | +- [Documentation](#documentation) |
| 14 | +- [Issue Reporting](#issue-reporting) |
| 15 | +- [Community](#community) |
| 16 | + |
| 17 | +## Code of Conduct |
| 18 | + |
| 19 | +Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms. |
| 20 | + |
| 21 | +## Getting Started |
| 22 | + |
| 23 | +1. **Fork the repository** on GitHub |
| 24 | +2. **Clone** your fork locally: |
| 25 | + ``` |
| 26 | + git clone https://github.com/YOUR-USERNAME/swiftglass.git |
| 27 | + cd swiftglass |
| 28 | + ``` |
| 29 | +3. **Set up the remote upstream**: |
| 30 | + ``` |
| 31 | + git remote add upstream https://github.com/1998code/swiftglass.git |
| 32 | + ``` |
| 33 | +4. **Create a branch** for your work: |
| 34 | + ``` |
| 35 | + git checkout -b your-feature-name |
| 36 | + ``` |
| 37 | + |
| 38 | +## Development Setup |
| 39 | + |
| 40 | +Follow these steps to set up your development environment: |
| 41 | + |
| 42 | +1. **Requirements:** |
| 43 | + - Xcode 15.0 or later |
| 44 | + - Swift 5.9 or later |
| 45 | + - macOS 14.0 or later |
| 46 | + |
| 47 | +2. **Open the Package:** |
| 48 | + ``` |
| 49 | + open Package.swift |
| 50 | + ``` |
| 51 | + Or open the package directly in Xcode by double-clicking the Package.swift file |
| 52 | + |
| 53 | +3. **Build the Package:** |
| 54 | + - In Xcode, select Product > Build to build the package |
| 55 | + - Alternatively, use the command line: |
| 56 | + ``` |
| 57 | + swift build |
| 58 | + ``` |
| 59 | + |
| 60 | +<!-- 4. **Run Tests:** |
| 61 | + - In Xcode, select Product > Test to run tests |
| 62 | + - Alternatively, use the command line: |
| 63 | + ``` |
| 64 | + swift test |
| 65 | + ``` --> |
| 66 | + |
| 67 | +## Pull Request Process |
| 68 | + |
| 69 | +1. **Update your fork** with the latest changes from the upstream repository: |
| 70 | + ``` |
| 71 | + git fetch upstream |
| 72 | + git merge upstream/main |
| 73 | + ``` |
| 74 | +2. **Commit** your changes with clear commit messages |
| 75 | +3. **Push** to your fork: |
| 76 | + ``` |
| 77 | + git push origin your-feature-name |
| 78 | + ``` |
| 79 | +4. **Submit a Pull Request** through the GitHub interface |
| 80 | +5. **Respond to feedback** and make requested changes if needed |
| 81 | +6. Once approved, your PR will be merged by a maintainer |
| 82 | + |
| 83 | +## Coding Standards |
| 84 | + |
| 85 | +Please follow these guidelines when writing code: |
| 86 | + |
| 87 | +- Use consistent indentation |
| 88 | +- Follow naming conventions for variables, functions, and classes |
| 89 | +- Write clear comments for complex code sections |
| 90 | +- Break large functions into smaller, more manageable ones |
| 91 | +- Remove any debugging code or console logs before submitting |
| 92 | +- Format your code using the project's linter configuration |
| 93 | + |
| 94 | +## Commit Guidelines |
| 95 | + |
| 96 | +We follow conventional commits for our commit messages: |
| 97 | + |
| 98 | +Example: `Add new examples` |
| 99 | + |
| 100 | +## Testing |
| 101 | + |
| 102 | +Before submitting your PR, ensure: |
| 103 | + |
| 104 | +1. All existing tests pass |
| 105 | +2. You've added tests for new functionality |
| 106 | +3. Your changes don't break existing functionality |
| 107 | + |
| 108 | +## Documentation |
| 109 | + |
| 110 | +Please update documentation when: |
| 111 | + |
| 112 | +- Adding new features |
| 113 | +- Changing existing functionality |
| 114 | +- Fixing bugs that affect user experience |
| 115 | +- Updating dependencies or configuration |
| 116 | + |
| 117 | +## Issue Reporting |
| 118 | + |
| 119 | +When reporting issues, please include: |
| 120 | + |
| 121 | +1. A clear, descriptive title |
| 122 | +2. Steps to reproduce the issue |
| 123 | +3. Expected behavior |
| 124 | +4. Actual behavior |
| 125 | +5. Screenshots if applicable |
| 126 | +6. Environment information (OS, Xcode Version, etc.) |
| 127 | + |
| 128 | +## Community |
| 129 | + |
| 130 | +- Star our repository on [GitHub](https://github.com/1998code/swiftglass) |
| 131 | +- Follow [1998code](https://github.com/1998code) for updates |
| 132 | +- Report issues and suggest features through [GitHub Issues](https://github.com/1998code/swiftglass/issues) |
| 133 | + |
| 134 | +Thank you for contributing to SwiftGlass! Your help makes this project better for everyone. |
0 commit comments