-
Notifications
You must be signed in to change notification settings - Fork 344
Auto-format README.md #341
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
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
|
|
@@ -2390,7 +2390,7 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
|
|
||
| - <a id='unused-function-parameter-naming'></a>(<a href='#unused-function-parameter-naming'>link</a>) **Name unused function parameters as underscores (`_`).** | ||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| [](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#unusedArguments) | ||
|
|
||
|
|
@@ -2458,7 +2458,7 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
| } | ||
| ``` | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| - <a id='remove-blank-lines-between-chained-functions'></a>(<a href='#remove-blank-lines-between-chained-functions'>link</a>) **Remove blank lines between chained functions.** | ||
|
|
||
|
|
@@ -2562,7 +2562,7 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
|
|
||
| - <a id='unused-closure-parameter-naming'></a>(<a href='#unused-closure-parameter-naming'>link</a>) **Name unused closure parameters as underscores (`_`).** | ||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| [](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#unusedArguments) | ||
|
|
||
|
|
@@ -2583,7 +2583,7 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
| } | ||
| ``` | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| - <a id='closure-brace-spacing'></a>(<a href='#closure-brace-spacing'>link</a>) **Closures should have a single space or newline inside each brace.** Trailing closures should additionally have a single space or newline outside each brace. | ||
|
|
||
|
|
@@ -3896,7 +3896,7 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
|
|
||
| - <a id='redundant-get'></a>(<a href='#redundant-get'>link</a>) **Omit the `get` clause from a computed property declaration that doesn't also have a `set`, `willSet`, or `didSet` clause.** | ||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| [](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#redundantGet) | ||
|
|
||
|
|
@@ -3920,11 +3920,11 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
| } | ||
| ``` | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| - <a id='prefer-opaque-generic-parameters'></a>(<a href='#prefer-opaque-generic-parameters'>link</a>) **Prefer using opaque generic parameters (with `some`) over verbose named generic parameter syntax where possible.** | ||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| [](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#opaqueGenericParameters) | ||
|
|
||
|
|
@@ -3998,11 +3998,11 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
|
|
||
| `some Any` is somewhat unintuitive, and the named generic parameter is useful in this situation to compensate for the weak type information. Because of this, prefer using named generic parameters instead of `some Any`. | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| - <a id='unchecked-sendable'></a>(<a href='#unchecked-sendable'>link</a>) **Prefer to avoid using `@unchecked Sendable`**. Use a standard `Sendable` conformance instead where possible. If working with a type from a module that has not yet been updated to support Swift Concurrency, suppress concurrency-related errors using `@preconcurrency import`. | ||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| `@unchecked Sendable` provides no guarantees about the thread safety of a type, and instead unsafely suppresses compiler errors related to concurrency checking. | ||
|
|
||
|
|
@@ -4157,11 +4157,11 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
| extension PlanetaryBody: @unchecked Sendable { } | ||
| ``` | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| - <a id='redundant-property'></a>(<a href='#redundant-property'>link</a>) **Avoid defining properties that are then returned immediately.** Instead, return the value directly. | ||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| [](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#redundantProperty) | ||
|
|
||
|
|
@@ -4195,11 +4195,11 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
| } | ||
| ``` | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| - <a id='redundant-equatable-implementation'></a>(<a href='#redundant-equatable-implementation'>link</a>) **Prefer using a generated Equatable implementation when comparing all properties of a type.** For structs, prefer using the compiler-synthesized Equatable implementation when possible. | ||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| [](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#redundantEquatable) | ||
|
|
||
|
|
@@ -4265,11 +4265,11 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
| } | ||
| ``` | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| - <a id='redundant-environment-key-implementation'></a>(<a href='#redundant-environment-key-implementation'>link</a>) **Prefer using the `@Entry` macro to define properties inside `EnvironmentValues`**. When adding properties to SwiftUI `EnvironmentValues`, prefer using the compiler-synthesized property implementation when possible. | ||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| [](https://github.com/nicklockwood/SwiftFormat/blob/develop/Rules.md#environmentEntry) | ||
|
|
||
|
|
@@ -4296,7 +4296,7 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
| } | ||
| ``` | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| - <a id='void-type'></a>(<a href='#void-type'>link</a>) **Avoid using `()` as a type**. Prefer `Void`. | ||
|
|
||
|
|
@@ -4352,7 +4352,7 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
|
|
||
| - <a id='url-macro'></a>(<a href='#url-macro'>link</a>) **If available in your project, prefer using a `#URL(_:)` macro instead of force-unwrapping `URL(string:)!` initializer`**. | ||
|
||
|
|
||
| <details> | ||
| <details> | ||
|
|
||
| [](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#urlMacro) | ||
|
|
||
|
|
@@ -4368,7 +4368,7 @@ _You can enable the following settings in Xcode by running [this script](resourc | |
| let url = #URL("https://example.com") | ||
| ``` | ||
|
|
||
| </details> | ||
| </details> | ||
|
|
||
| **[⬆ back to top](#table-of-contents)** | ||
|
|
||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@calda do you have a sense of why some of these details tags were indented further than others? I am asking to learn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figure it was unintentional