Skip to content

Commit afb4ebd

Browse files
committed
Add CI for DocC warnings (#750)
* Add CI for DocC warnings * More specific grep
1 parent 897f30b commit afb4ebd

File tree

6 files changed

+44
-25
lines changed

6 files changed

+44
-25
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
- uses: actions/checkout@v2
3636
- name: Select Xcode ${{ matrix.xcode }}
3737
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
38+
- name: Compile documentation
39+
run: make test-docs
3840
- name: Run tests
3941
run: make test-library
4042
- name: Run benchmark

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ test-library:
2121
-scheme ComposableArchitecture_watchOS \
2222
-destination platform="$(PLATFORM_WATCHOS)"
2323

24+
DOC_WARNINGS := $(shell xcodebuild clean docbuild \
25+
-scheme ComposableArchitecture \
26+
-destination platform="$(PLATFORM_MACOS)" \
27+
-quiet \
28+
2>&1 \
29+
| grep "couldn't be resolved to known documentation" \
30+
| sed 's|$(PWD)|.|g' \
31+
| tr '\n' '\1')
32+
test-docs:
33+
@test "$(DOC_WARNINGS)" = "" \
34+
|| (echo "xcodebuild docbuild failed:\n\n$(DOC_WARNINGS)" | tr '\1' '\n' \
35+
&& exit 1)
36+
2437
test-examples:
2538
xcodebuild test \
2639
-scheme "CaseStudies (SwiftUI)" \

Sources/ComposableArchitecture/Debugging/ReducerDebugging.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import CasePaths
22
import Dispatch
33

4-
/// Determines how the string description of an action should be printed when using the ``Reducer/debug(prefix:state:action:environment:)``
5-
/// higher-order reducer.
4+
/// Determines how the string description of an action should be printed when using the
5+
/// ``Reducer/debug(_:state:action:actionFormat:environment:)`` higher-order reducer.
66
public enum ActionFormat {
77
/// Prints the action in a single line by only specifying the labels of the associated values:
88
///

Sources/ComposableArchitecture/Reducer.swift

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ public struct Reducer<State, Action, Environment> {
7575
/// action.
7676
///
7777
/// Similar can be said for a
78-
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer. If the
78+
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer. If the
7979
/// parent domain modifies the child collection by moving, removing, or modifying an element
80-
/// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer
81-
/// runs, the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer may
80+
/// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573``
81+
/// reducer runs, the
82+
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer may
8283
/// perform its action against the wrong element, an element that no longer exists, or an element
8384
/// in an unexpected state.
8485
///
@@ -132,10 +133,11 @@ public struct Reducer<State, Action, Environment> {
132133
/// action.
133134
///
134135
/// Similar can be said for a
135-
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer. If the
136+
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer. If the
136137
/// parent domain modifies the child collection by moving, removing, or modifying an element
137-
/// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer
138-
/// runs, the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer may
138+
/// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573``
139+
/// reducer runs, the
140+
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer may
139141
/// perform its action against the wrong element, an element that no longer exists, or an element
140142
/// in an unexpected state.
141143
///
@@ -191,10 +193,11 @@ public struct Reducer<State, Action, Environment> {
191193
/// action.
192194
///
193195
/// Similar can be said for a
194-
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer. If the
196+
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer. If the
195197
/// parent domain modifies the child collection by moving, removing, or modifying an element
196-
/// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer
197-
/// runs, the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer may
198+
/// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573``
199+
/// reducer runs, the
200+
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer may
198201
/// perform its action against the wrong element, an element that no longer exists, or an element
199202
/// in an unexpected state.
200203
///
@@ -305,7 +308,7 @@ public struct Reducer<State, Action, Environment> {
305308
/// operator to pullback a reducer that operates on a single case of some state enum to work on
306309
/// the entire state enum.
307310
///
308-
/// When used with the ``combine(_:)-994ake`` operator you can define many reducers that work each
311+
/// When used with the ``combine(_:)-994ak`` operator you can define many reducers that work each
309312
/// case of the state enum, and then _pull them back_ and _combine_ them into one big reducer that
310313
/// works on a large domain.
311314
///
@@ -736,10 +739,11 @@ public struct Reducer<State, Action, Environment> {
736739
/// )
737740
/// ```
738741
///
739-
/// Take care when combining ``forEach(state:action:environment:breakpointOnNil:_:_:)-90ox5``
740-
/// reducers into parent domains, as order matters. Always combine
741-
/// ``forEach(state:action:environment:breakpointOnNil:_:_:)-90ox5`` reducers _before_ parent
742-
/// reducers that can modify the collection.
742+
/// Take care when combining
743+
/// ``forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducers into parent
744+
/// domains, as order matters. Always combine
745+
/// ``forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducers _before_
746+
/// parent reducers that can modify the collection.
743747
///
744748
/// - Parameters:
745749
/// - toLocalState: A key path that can get/set a collection of `State` elements inside
@@ -809,10 +813,11 @@ public struct Reducer<State, Action, Environment> {
809813
/// A version of ``pullback(state:action:environment:)`` that transforms a reducer that works on
810814
/// an element into one that works on a dictionary of element values.
811815
///
812-
/// Take care when combining ``forEach(state:action:environment:breakpointOnNil:_:_:)-xv1z``
816+
/// Take care when combining
817+
/// ``forEach(state:action:environment:breakpointOnNil:file:line:)-1h7qx``
813818
/// reducers into parent domains, as order matters. Always combine
814-
/// ``forEach(state:action:environment:breakpointOnNil:_:_:)-xv1z`` reducers _before_ parent
815-
/// reducers that can modify the dictionary.
819+
/// ``forEach(state:action:environment:breakpointOnNil:file:line:)-1h7qx`` reducers _before_
820+
/// parent reducers that can modify the dictionary.
816821
///
817822
/// - Parameters:
818823
/// - toLocalState: A key path that can get/set a dictionary of `State` values inside

Sources/ComposableArchitecture/SwiftUI/ForEachStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import SwiftUI
5151
/// ```
5252
///
5353
/// Enhance its reducer using
54-
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87``:
54+
/// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573``:
5555
///
5656
/// ```swift
5757
/// let appReducer = todoReducer.forEach(

Sources/ComposableArchitecture/SwiftUI/SwitchStore.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ import SwiftUI
4848
/// }
4949
/// ```
5050
///
51-
/// - See also: ``Reducer/pullback(state:action:environment:breakpointOnNil:_:_:)``, a method that
52-
/// aids in transforming reducers that operate on each case of an enum into reducers that operate
53-
/// on the entire enum.
54-
///
55-
@available(iOS 13, macOS 10.15, macCatalyst 13, tvOS 13, watchOS 6, *)
51+
/// - See also: ``Reducer/pullback(state:action:environment:breakpointOnNil:file:line:)``, a method
52+
/// that aids in transforming reducers that operate on each case of an enum into reducers that
53+
/// operate on the entire enum.
54+
@available(iOS 13, macOS 10.15, macCatalyst 13, tvOS 13, watchOS 6, *)
5655
public struct SwitchStore<State, Action, Content>: View where Content: View {
5756
public let store: Store<State, Action>
5857
public let content: () -> Content

0 commit comments

Comments
 (0)