Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull Requst

on: [pull_request]

jobs:
lint:
name: Lint Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint Formatting
run: swift format lint --recursive --strict .

test-ubuntu-latest:
name: Test Swift ${{ matrix.swift }} Ubuntu Latest
strategy:
matrix:
swift: ["6.0", "6.0.1", "6.0.2"]
runs-on: ubuntu-latest
container: swift:${{ matrix.swift }}
steps:
- uses: actions/checkout@v4
- name: Run Tests
run: swift test -Xswiftc -warnings-as-errors -Xcc -Werror
24 changes: 24 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"indentation" : {
"spaces" : 4
},
"indentConditionalCompilationBlocks" : false,
"indentSwitchCaseLabels" : true,
"lineLength" : 140,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : true,
"NeverForceUnwrap" : true,
"NeverUseForceTry" : true,
"NeverUseImplicitlyUnwrappedOptionals" : true,
"NoLeadingUnderscores" : true,
"OmitExplicitReturns" : true,
"UseEarlyExits" : true,
"UseWhereClausesInForLoops" : true,
"ValidateDocumentationComments" : true
},
"spacesAroundRangeFormationOperators" : true,
"version" : 1
}
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.2"),
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.2")
],
targets: [
.target(
Expand All @@ -28,13 +28,13 @@ let package = Package(
.target(
name: "RealModuleDifferentiable",
dependencies: [
.product(name: "RealModule", package: "swift-numerics"),
.product(name: "RealModule", package: "swift-numerics")
]
),
.testTarget(
name: "RealModuleDifferentiableTests",
dependencies: [
"RealModuleDifferentiable",
"RealModuleDifferentiable"
]
),
]
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# swift-numerics-differentiable
# swift-numerics-differentiable

## Contributing
### Code Formatting
This package makes use of [swift-format](https://github.com/swiftlang/swift-format), which is built directly into the swift toolchain as of
swift 6. To apply formatting rules to all files, which you should do before submitting a PR, run from the root of the repository:

```sh
swift format --in-place --recursive .
```

Formatting is validated with the `--strict` flag on every PR