You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Guides/Development.md
+5-13Lines changed: 5 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,7 @@ Run `swift build` or simply `make` in the project's root directory.
31
31
If you add symbols you may need to run `make exports` which will generate [Sources/MongoSwiftSync/Exports.swift](Sources/MongoSwiftSync/Exports.swift). This makes symbols declared in `MongoSwift` available to importers of `MongoSwiftSync`.
32
32
33
33
### In Xcode
34
-
We do not provide or maintain an already-generated `.xcodeproj` in our repository. Instead, you must generate it locally.
35
-
36
-
**To generate the `.xcodeproj` file**:
37
-
1. Install the Ruby gem `xcodeproj` with `gem install xcodeproj` (you may need to `sudo`)
38
-
2. Run `make project`
39
-
3. You're ready to go! Open `MongoSwift.xcodeproj` and build and test as normal.
40
-
41
-
Why is this necessary? The project requires a customized "copy resources" build phase to include various test `.json` files. By default, this phase is not included when you run `swift package generate-xcodeproj`. So `make project` first generates the project, and then uses `xcodeproj` to manually add the files to the appropriate targets (see `add_json_files.rb`).
34
+
From the driver root directory, you can run `xed .` to open the project in xcode and be able to build and run there.
42
35
43
36
## Running Tests
44
37
**NOTE**: Several of the tests require a mongod instance to be running on the default host/port, `localhost:27017`. You can start this by running `mongod --setParameter enableTestCommands=1`. The `enableTestCommands` parameter is required to use some test-only commands built into MongoDB that we utilize in our tests, e.g. `failCommand`.
@@ -76,12 +69,14 @@ Our documentation site is automatically generated from the source code using [Ja
76
69
If you'd like to preview how new documentation you've written will look when published, you can regenerate it by running `./etc/generate-docs.sh` and then inspecting the generated HTML files in `/docs`.
77
70
78
71
## Linting and Style
79
-
We use [SwiftLint](https://github.com/realm/SwiftLint#using-homebrew) for linting. You can see our configuration in the `.swiftlint.yml` file in the project's root directory. Run `swiftlint` in the root directory to lint all of our files. Running `swiftlint autocorrect` will correct some types of violations.
72
+
We use [SwiftLint](https://github.com/realm/SwiftLint#using-homebrew) for linting. You can see our configuration in the `.swiftlint.yml` file in the project's root directory. Run `swiftlint` in the root directory to lint all of our files. Running `swiftlint --fix` will correct some types of violations.
80
73
81
74
We use [SwiftFormat](https://github.com/nicklockwood/SwiftFormat) for formatting the code. You can see our configuration in the `.swiftformat` file in the project's root directory. Our linter config contains a superset of the rules that our formatter does, so some manual tweaking may be necessary to satisfy both once the formatter is run (e.g. line length enforcement). Most of the time, the formatter should put the code into a format that passes the linter. You can run the formatter on all of the files by running `swiftformat .` from the root directory.
82
75
83
76
To pass all the formatting stages of our testing matrix, both `swiftlint --strict` and `swiftformat --lint .` must finish successfully.
For style guidance, look at Swift's [API design guidelines](https://swift.org/documentation/api-design-guidelines/) and Google's [Swift Style Guide](https://google.github.io/swift/).
86
81
87
82
## Editor Setup
@@ -116,11 +111,8 @@ If you have a setup for developing the driver in an editor other than the ones l
116
111
## Workflow
117
112
1. Create a feature branch, named by the corresponding JIRA ticket if exists, along with a short descriptor of the work: for example, `SWIFT-30/writeconcern`.
118
113
1. Do your work on the branch.
119
-
1. If you add, remove, or rename any tests, make sure to update `LinuxMain.swift` accordingly. If you are on MacOS, you can do that by running `make linuxmain`.
120
114
1. Ensure your code passes both the linter and the formatter.
121
-
1. Make sure your code builds and passes all tests on:
122
-
-[Travis](https://travis-ci.org/mongodb/mongo-swift-driver). Every time you push to GitHub or open a pull request, it will trigger a new build, which includes running the linter, formatter, and basic tests.
123
-
- (If you work at MongoDB) [Evergreen](https://evergreen.mongodb.com/waterfall/mongo-swift-driver) - Our Evergreen matrix tests a variety of MongoDB configurations, operating systems, and Swift language versions, and provides a way to more robustly test the driver. A new Evergreen build is automatically triggered for every commit to `main`, but for more complex pull requests it's a good idea to run patches on Evergreen before merging.
115
+
1. Make sure your code builds and passes all tests on [Evergreen](https://evergreen.mongodb.com/waterfall/mongo-swift-driver). Our Evergreen matrix tests a variety of MongoDB configurations, operating systems, and Swift language versions, and provides a way to more robustly test the driver. If you work at MongoDB, a new Evergreen build is automatically triggered for every commit to `main` and for every pull request. If you do not work at MongoDB, ask a maintainer to trigger a test run on evergreen for you.
124
116
1. Open a pull request on the repository. Make sure you have rebased your branch onto the latest commits on `main`.
125
117
1. Go through code review to get the team's approval on your changes. (See the next section on [Code Review](#code-review) for more details on this process.) Once you get the required approvals and your code passes all tests:
0 commit comments