Skip to content

Commit

Permalink
[PDT-1456] Added screen owner rule to Danger article (#397)
Browse files Browse the repository at this point in the history
* Added screen owner rule to Danger article

* Added how to resolve
  • Loading branch information
Daniel Spindelbauer authored Sep 17, 2020
1 parent 01e7b20 commit 3a990cb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Cookbook/Technical-Documents/DangerRules.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,24 @@ In that case, for each target+config, the rule will report a failure, and also a
This will report swiftlint violations as inline comments (warnings) in the Pull Request.

Only `.swift` files that are part of the PR are linted by this rule; so only violations in files that were added/modified/renamed by the PR will be reported. This is to ensure that we don't introduce new violations, and that we fix existing violations on any file we touch or update.

## Detect Missing Screenowner

> * Declared in: `danger-ci/screenowner.rb`
> * Function: `check_screenowner_is_set`
> * Type: ⚠️ warning
This will report any View Models that are missing a screen owner as a warning in the Pull Request.

Only `*ViewModel.swift` files that are part of the PR are linted by this rule; so only violations in files that were added/modified/renamed by the PR will be reported. This is to ensure that we don't introduce new violations, and that we fix existing violations on any file we touch or update. Similarly to [missing feedbacks](#detect-missing-feedbacks).

How to resolve: add the following definition to the affected View Model(s)

```swift
extension ExampleViewModel: ScreenAttributes {
var screenOwner: Squad? {
// set the appropriate squad here
}
}
```

0 comments on commit 3a990cb

Please sign in to comment.