-
Notifications
You must be signed in to change notification settings - Fork 129
Add contributor guide and pull request template #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+118
−1
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ## Summary | ||
|
|
||
| <!-- What does this PR change, and why? Link related issues with "Fixes #123". --> | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] Unit tests cover the change (bug fixes include a regression test) | ||
| - [ ] `xcodebuild test -scheme SwipeMenuViewController` passes locally | ||
| - [ ] `swift format lint --strict` passes and the tree is formatter-clean | ||
| - [ ] Public API changes update the DocC documentation | ||
| - [ ] User-facing changes have a CHANGELOG entry under **Unreleased** | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # Contributing to SwipeMenuViewController | ||
|
|
||
| Thank you for considering a contribution! Bug reports, fixes, documentation | ||
| improvements, and well-scoped features are all welcome. This document explains | ||
| how to get the project running locally and what a pull request needs before it | ||
| can be merged. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Xcode 26.0 or later (Swift 6.2 toolchain) | ||
| - [XcodeGen](https://github.com/yonaskolb/XcodeGen) — only if you work on the example app | ||
|
|
||
| ## Project layout | ||
|
|
||
| | Path | What it is | | ||
| |---|---| | ||
| | `Package.swift` | Swift package manifest — the library is SPM-only | | ||
| | `Sources/SwipeMenuViewController/` | Library sources and the DocC catalog | | ||
| | `Tests/SwipeMenuViewControllerTests/` | Unit tests (Swift Testing, run on the iOS simulator) | | ||
| | `Example/` | Demo app consuming the library as a local package | | ||
|
|
||
| ## Building and testing | ||
|
|
||
| Open the package directly in Xcode (`File ▸ Open… ▸ Package.swift`) or run the | ||
| tests from the command line against any available iPhone simulator: | ||
|
|
||
| ```sh | ||
| xcodebuild test \ | ||
| -scheme SwipeMenuViewController \ | ||
| -destination 'platform=iOS Simulator,name=iPhone 17' \ | ||
| CODE_SIGNING_ALLOWED=NO | ||
| ``` | ||
|
|
||
| Replace `iPhone 17` with any simulator you have installed | ||
| (`xcrun simctl list devices available`). | ||
|
|
||
| ## Example app | ||
|
|
||
| The example app's Xcode project is generated — `Example.xcodeproj` is not | ||
| committed, and [`Example/project.yml`](Example/project.yml) is the source of | ||
| truth: | ||
|
|
||
| ```sh | ||
| cd Example | ||
| xcodegen generate | ||
| open Example.xcodeproj | ||
| ``` | ||
|
|
||
| Re-run `xcodegen generate` whenever you change `project.yml`. See the | ||
| [Example README](Example/README.md) for details. | ||
|
|
||
| ## Formatting and linting | ||
|
|
||
| The codebase is formatted and linted with the Swift toolchain's built-in | ||
| [swift-format](https://github.com/swiftlang/swift-format); the configuration | ||
| lives in [`.swift-format`](.swift-format). Before pushing: | ||
|
yysskk marked this conversation as resolved.
|
||
|
|
||
| ```sh | ||
| swift format --in-place --recursive --parallel Sources Tests Example/Example Example/ExampleTests Package.swift | ||
| swift format lint --strict --recursive --parallel Sources Tests Example/Example Example/ExampleTests Package.swift | ||
| ``` | ||
|
|
||
| CI fails if the tree is not formatter-clean or any lint rule fires. | ||
|
yysskk marked this conversation as resolved.
|
||
|
|
||
| ## Documentation | ||
|
|
||
| The public API is documented with DocC (`Sources/SwipeMenuViewController/SwipeMenuViewController.docc`). | ||
| If your change touches the public API, update the documentation comments and, | ||
| where relevant, the articles. CI builds the documentation with warnings treated | ||
| as errors, so broken symbol links fail the build: | ||
|
|
||
| ```sh | ||
| xcodebuild docbuild \ | ||
| -scheme SwipeMenuViewController \ | ||
| -destination 'generic/platform=iOS Simulator' \ | ||
| CODE_SIGNING_ALLOWED=NO \ | ||
| OTHER_DOCC_FLAGS='--warnings-as-errors' | ||
| ``` | ||
|
|
||
| The published documentation at | ||
| [yysskk.github.io/SwipeMenuViewController](https://yysskk.github.io/SwipeMenuViewController/documentation/swipemenuviewcontroller/) | ||
| is deployed automatically from `main`. | ||
|
|
||
| ## Changelog | ||
|
|
||
| User-facing changes (new options, behavior changes, bug fixes) get an entry in | ||
| the **Unreleased** section of [CHANGELOG.md](CHANGELOG.md). Internal refactors | ||
| and CI changes do not need one. | ||
|
|
||
| ## Pull requests | ||
|
|
||
| 1. Fork and create a topic branch from `main`. | ||
| 2. Keep the PR focused; unrelated changes belong in separate PRs. | ||
| 3. Add or update unit tests for what you change — bug fixes need a regression | ||
| test that fails without the fix. | ||
| 4. Make sure the test suite, the formatter, and the documentation build all | ||
| pass locally. | ||
| 5. Fill in the pull request template. CI (tests, example build, documentation, | ||
| swift-format) must be green before review. | ||
|
yysskk marked this conversation as resolved.
|
||
|
|
||
| For anything larger than a bug fix, consider opening an issue first to discuss | ||
| the direction. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.