Skip to content

Commit a569248

Browse files
Add SwiftFormat and patch size / number of commits info in Contributing
1 parent 2c12273 commit a569248

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

Documentation/Contributing.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ $> ./swift/utils/build-script --preset=buildbot_swiftpm_linux_platform,tools=RA,
7575

7676
```bash
7777
$> git clone https://github.com/apple/swift-llbuild llbuild
78-
$> ls
79-
swiftpm llbuild
8078
```
8179

8280
Note: Make sure the directory for llbuild is called "llbuild" and not
@@ -94,10 +92,11 @@ $> git clone https://github.com/jpsim/yams
9492
$> git clone https://github.com/apple/swift-driver
9593
```
9694

97-
6. Clone [swift-argument-parser](https://github.com/apple/swift-argument-parser) beside the package manager directory and check out tag 0.3.0.
95+
6. Clone [swift-argument-parser](https://github.com/apple/swift-argument-parser) beside the package manager directory and check out tag with the [latest version](https://github.com/apple/swift-argument-parser/tags).
9896

97+
For example, if the latest tag is 0.3.1:
9998
```bash
100-
$> git clone https://github.com/apple/swift-argument-parser --branch 0.3.0
99+
$> git clone https://github.com/apple/swift-argument-parser --branch 0.3.1
101100
```
102101

103102
7. Build the Swift Package Manager.
@@ -113,7 +112,7 @@ This command builds the Package Manager inside the `.build/` directory.
113112
Run the bootstrap script to rebuild after making a change to the source
114113
code.
115114

116-
<a id="self-hosting">*D) _Self Hosting_*</a>:
115+
<a id="self-hosting">*_Self Hosting_*</a>:
117116

118117
It is possible to build SwiftPM with itself using SwiftPM present in latest
119118
release of Xcode or the latest trunk snapshot on Linux.
@@ -126,6 +125,7 @@ $> swift build
126125
$> swift test --parallel
127126

128127
# Run a single test.
128+
For example, to only run the `PackageGraphTests.DependencyResolverTests/testBasics`
129129
$> swift test --filter PackageGraphTests.DependencyResolverTests/testBasics
130130

131131
# Run tests for the test targets BuildTests and WorkspaceTests, but skip some test cases.
@@ -175,7 +175,7 @@ $> /path/to/swiftpm/.build/x86_64-apple-macosx/debug/swift-build
175175
$> Utilities/bootstrap test
176176
```
177177

178-
## Getting Started
178+
## Building
179179
1. Pull the SwiftPM repository:
180180
```bash
181181
$> git clone https://github.com/apple/swift-package-manager.git
@@ -207,13 +207,13 @@ If you need to build the generated binaries, run `swift-build` in inside `.build
207207
## Running Tests
208208
### Run all tests.
209209
```bash
210-
$> swift test --parallel
210+
$> swift test
211211
```
212212
### Run a single test.
213213
```bash
214214
$> swift test --filter PackageGraphTests.DependencyResolverTests/testBasics
215215
```
216-
### Run tests for the test targets BuildTests and WorkspaceTests, but skip some test cases.
216+
Or another example, to run tests for the test targets BuildTests and WorkspaceTests, but skip some test cases.
217217
```bash
218218
$> swift test --filter BuildTests --skip BuildPlanTests --filter WorkspaceTests --skip InitTests
219219
```
@@ -226,7 +226,7 @@ $> export TSC_ENABLE_PERF_TESTS=1
226226
$> swift test -c release --filter PerformanceTests
227227
```
228228

229-
For example, testing basic functionality using the newly created binaries
229+
To test SwiftPM functionality using the newly created binaries, you can invoke them from the `.build` directory. For example:
230230

231231
```bash
232232
$> cd /tmp && mkdir hello && cd hello
@@ -252,12 +252,13 @@ $> Utilities/Docker/docker-utils swift-run # to run swift-run in the container
252252
2. Clone a working copy of your fork
253253
3. Create a new branch
254254
4. Make your code changes
255-
5. Commit (include the Radar link or JIRA issue id in the commit message if possible and a description your changes)
256-
6. Push the commit / branch to your fork
257-
7. Make a PR from your fork / branch to `apple: main`
258-
8. Leave a new comment to trigger smoke tests: `@swift-ci please smoke test`
259-
9. Reviewers are going to be automatically added to your PR
260-
10. Merge pull request when you received approval from the reviewers (one or more)
255+
5. Try to keep your changes (when possible) below 200 lines of code.
256+
6. We use [SwiftFormat](https://www.github.com/nicklockwood/SwiftFormat) to enforce code style. Please install and run SwiftFormat before submitting your PR.
257+
7. Commit (include the Radar link or JIRA issue id in the commit message if possible and a description your changes). Try to have only 1 commit in your PR (but, of course, if you add changes that can be helpful to be kept aside from the previous commit, make a new commit for them).
258+
8. Push the commit / branch to your fork
259+
9. Make a PR from your fork / branch to `apple: main`
260+
10. Reviewers are going to be automatically added to your PR
261+
11. Merge pull request when you received approval from the reviewers (one or more)
261262

262263
## Using Continuous Integration
263264
SwiftPM uses [swift-ci](https://ci.swift.org) infrastructure for its continuous integration testing. The bots can be triggered on pull-requests if you have commit access. Otherwise, ask

0 commit comments

Comments
 (0)