Incorporating PR suggestions and change requests

This commit is contained in:
Francisco Gindre 2021-09-09 16:06:46 -03:00
parent a72ced4639
commit f713b88335
3 changed files with 14 additions and 11 deletions

View File

@ -5,9 +5,9 @@ This code review checklist is intended to serve as a starting point for the auth
- [ ] Self-review: Did you review your own code in GitHub's web interface? Code often looks different when reviewing the diff in a browser, making it easier to spot potential bugs. - [ ] Self-review: Did you review your own code in GitHub's web interface? Code often looks different when reviewing the diff in a browser, making it easier to spot potential bugs.
- [ ] Automated tests: Did you add appropriate automated tests for any code changes? - [ ] Automated tests: Did you add appropriate automated tests for any code changes?
- [ ] Code coverage: Did you check the code coverage report for the automated tests? While we are not looking for perfect coverage, the tool can point out potential cases that have been missed. - [ ] Code coverage: Did you check the code coverage report for the automated tests? While we are not looking for perfect coverage, the tool can point out potential cases that have been missed.
- [ ] Documentation: Did you update Docs as appropiate? (E.g [README.md](../blob/main/README.md), [LICENSE.md](../blob/main/LICENSE.md), etc.) - [ ] Documentation: Did you update Docs as appropiate? (E.g [README.md](../blob/main/README.md), etc.)
- [ ] Run the app: Did you run the app and try the changes? - [ ] Run the app: Did you run the app and try the changes?
- [ ] Did you provide Screenshots of what the App looks like before and your changes? (only applicable to UI Changes) - [ ] Did you provide Screenshots of what the App looks like before and after your changes as part of the description of this PR? (only applicable to UI Changes)
- [ ] Rebase and squash: Did you pull in the latest changes from the main branch and squash your commits before assigning a reviewer? Having your code up to date and squashed will make it easier for others to review. Use best judgement when squashing commits, as some changes (such as refactoring) might be easier to review as a separate commit. - [ ] Rebase and squash: Did you pull in the latest changes from the main branch and squash your commits before assigning a reviewer? Having your code up to date and squashed will make it easier for others to review. Use best judgement when squashing commits, as some changes (such as refactoring) might be easier to review as a separate commit.

View File

@ -16,7 +16,7 @@ These guides use SwiftLint as a standard. You can learn more about SwiftLint by
* [Running SwiftLint](#running-swiftlint) * [Running SwiftLint](#running-swiftlint)
* [Handling rule exceptions](#handling-rule-exceptions) * [Handling rule exceptions](#handling-rule-exceptions)
* [Approved exceptions](#approved-exceptions) * [Approved exceptions](#approved-exceptions)
* [Implicitly Unwrapped Optionals](#implicitly-unwrapped-optionals) * [Implicitly unwrapped optionals](#implicitly-unwrapped-optionals)
* [Force cast](#force-cast) * [Force cast](#force-cast)
* [Force unwrapping](#force-unwrapping) * [Force unwrapping](#force-unwrapping)
* [SwiftUI and multiple trailing closures](#swiftui-and-multiple-trailing-closures) * [SwiftUI and multiple trailing closures](#swiftui-and-multiple-trailing-closures)
@ -82,9 +82,9 @@ There are certain common idioms that violate SwiftLint's strict checking. If you
If you find that you're struggling with rules other than those described below, please reach out to your Team Lead with your specific example. If you find that you're struggling with rules other than those described below, please reach out to your Team Lead with your specific example.
### Implicitly Unwrapped Optionals ### Implicitly unwrapped optionals
It is sometimes common, in lieu of using dependency injection, to declare a child view controller's properties as Implicitly Unwrapped Optionals (IUO). If you're unable to structure your project to avoid this, you may disable the `implicitly_unwrapped_optional` rule for those dependency declarations. With the advent of `@IBSegueAction`, this should be rare. It is sometimes common, in lieu of using dependency injection, to declare a child view controller's properties as implicitly unwrapped optionals (IUO). If you're unable to structure your project to avoid this, you may disable the `implicitly_unwrapped_optional` rule for those dependency declarations. With the advent of `@IBSegueAction`, this should be rare.
### Force cast ### Force cast
@ -133,6 +133,4 @@ Occasionally, you'll find it necessary to include an unmodified open-source file
## Other notes ## Other notes
While SwiftLint goes a long way towards making your source code compliant with our style guide, it doesn't cover everything. For example, it won't catch or force you to correct the formatting for multi-condition `guard` statements. (See [Golden Path](https://github.com/raywenderlich/swift-style-guide#golden-path) for correct formatting.) While SwiftLint goes a long way towards making your source code compliant with our style guide, it doesn't cover everything. For example, it won't catch or force you to correct the formatting for multi-condition `guard` statements. If you find yourself butting heads with SwiftLint, or have improvement suggestions, please file an Issue and send a PR request with your suggestions.
This configuration has been tested against several dozen of our most recent tutorials. A couple of rules, such as the line length limit or the limit on the length of a function, may need tweaking to fit our style. If you find yourself butting heads with SwiftLint, please reach out to the iOS Team Lead with details.

View File

@ -10,11 +10,12 @@ disabled_rules:
- orphaned_doc_comment - orphaned_doc_comment
- todo - todo
- unused_capture_list - unused_capture_list
opt_in_rules:
- nesting # allow for types to be nested, common pattern in Swift - nesting # allow for types to be nested, common pattern in Swift
- multiple_closures_with_trailing_closure - multiple_closures_with_trailing_closure
- generic_type_name # allow for arbitrarily long generic type names - generic_type_name # allow for arbitrarily long generic type names
opt_in_rules:
- mark
- array_init - array_init
- attributes - attributes
- closure_end_indentation - closure_end_indentation
@ -119,11 +120,15 @@ indentation_width:
indentation_width: 2 indentation_width: 2
line_length: line_length:
warning: 600 warning: 150
ignores_urls: true ignores_urls: true
ignores_function_declarations: true ignores_function_declarations: true
ignores_comments: true ignores_comments: true
file_length:
warning: 600
ignore_comment_only_lines: false: true
multiline_arguments: multiline_arguments:
first_argument_location: next_line first_argument_location: next_line
only_enforce_after_first_closure_on_first_line: true only_enforce_after_first_closure_on_first_line: true