-
Notifications
You must be signed in to change notification settings - Fork 51
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
Simplification, Clarification, Robotification #118
Conversation
COMMUNICATION.md
Outdated
It good practice to elaborate. It may seem inefficient to be so verbose in our replies, but it will avoid misunderstandings, which can result in way greater inefficiency. | ||
When you write a reply of less than ~5 words, have an alarm bell in the back of your head 🔔. Is it just tacit agreement? Then it’s probably fine! “Great job”, “Couldn’t have put it better”, “totes awesome!” are all fine. | ||
|
||
In every other case though: 🚨! It good practice to elaborate. It may seem inefficient to be so verbose in our replies, but it will avoid misunderstandings, which can result in far greater inefficiency. |
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.
It's
, missed a verb :)
COMMUNICATION.md
Outdated
|
||
- **I see you are using an optional as an array of User object in the example above**, have you considered to have that property default to an empty array? |
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.
to have
-> having
:)
COMMUNICATION.md
Outdated
@@ -1,51 +1,55 @@ | |||
# Communicating within the iOS team | |||
# Communicating With Your Colleagues |
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 find this http://titlecase.com/ to be handy, so we should not uppercase unimportant words. What do you think @designatednerd ?
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'd avoid "title case" altogether, and just use good ol' regular spelling rules. First word of the sentence and proper nouns only. 😀
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.
Yeah I think I did this a bit automatically as this is how I'm used to setting up titles in markdown documents. Will update.
@@ -4,20 +4,13 @@ These conventions apply to our open-source, internal, and client projects. | |||
|
|||
## Commits | |||
|
|||
The `master` branch is the stable branch. It's also used for development | |||
purposes, as to avoid having `dev`, `development`, `staging`, `wip` and others. | |||
The `master` branch is the stable branch. It's also used for development purposes, as to avoid having `dev`, `development`, `staging`, `wip` and others. |
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.
👍
STYLE_GUIDE.md
Outdated
@@ -0,0 +1,383 @@ | |||
# Swift Style Guide |
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.
Did you add this whole thing, or did you just extract it from somewhere else? I wonder if there's any changes made to this.
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 extracted it and condensed it from Best Practices
. There are definitely changes made to it to try and make it more concise and closer to enforcing what we're already doing.
- [ ] Send a tweet to [@maniacdev](https://twitter.com/maniacdev) | ||
- [ ] Send a tweet to [@daveverwer](https://twitter.com/daveverwer) and [@iOSDevWeekly](https://twitter.com/iOSDevWeekly) | ||
- [ ] Send a tweet to [@iOSGoodies](https://twitter.com/iOSGoodies) with the link to your PR | ||
- [ ] Send a tweet to [@NatashaTheRobot](https://twitter.com/NatashaTheRobot) |
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.
😭 But yeah, she quit :(
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.
So did Maniac Dev - they haven't posted anything since late last year, even on their twitter.
…rate table of contents
# Conflicts: # BEST_PRACTICES.md
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 think this is a great improvement, very well written too. 👌
COMMUNICATION.md
Outdated
@@ -1,51 +1,62 @@ | |||
# Communicating within the iOS team | |||
# Communicating with your colleaugues |
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.
One "u" too many. ;)
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.
🤦♀️
|
||
In every other case though: 🚨! It's good practice to elaborate. It may seem inefficient to be so verbose in our replies, but it will avoid misunderstandings, which can result in far greater inefficiency. | ||
|
||
## Criticizing or asking questions |
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.
👀 what happened here?
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.
🇺🇸 spelling to be internally consistent with everything I was rewriting
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.
Thanks for picking this up Ellen. I think it's great when we all agree what is in here 🙏
i left some comments about what could be clearer. But there's nothing in here that i disagree with!
I would like it though if we could add a rule about always giving a description or screenshot/gif with a PR. I think it saves valuable time for the reviewer if the requester makes clear what they worked on, how obvious it might seem to them! (the thing is the more obvious it is the easier it is to make a description, so everybody wins)
But i think we have this in danger, but i don't always see this giving a warning when there's no description 🤔 Or is it disabled?
default.swiftlint.yml
Outdated
- override_in_extension # Extensions shouldn't override declarations. | ||
- private_action # IBActions should be private. | ||
- private_outlet # IBOutlets should be private to avoid leaking UIKit to higher layers. | ||
- private_unit_test # Unit tests marked private are silently skipped. |
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.
Does this rule make sure we cannot mark tests as private because they are silently skipped when they are? Maybe clearer to word it like Unit tests should not be marked private because they are silently skipped
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.
You are correct. And I copy pasted this description from the list of SwiftLint rules, but I'll update it.
default.swiftlint.yml
Outdated
- prohibited_super_call # Some methods should not call super | ||
- redundant_nil_coalescing # nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant | ||
- switch_case_on_newline # Cases inside a switch should always be on a newline | ||
trailing_whitespace: |
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.
So this is giving you a warning when you add a whitespace at the end of a line, but skips empty lines?
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.
correct
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.
Thanks for taking the time to do such a major rewrite. Did a first pass read, left some comments about grammar/spelling and asked for clarification on some topics. 👍
GIT_AND_GITHUB.md
Outdated
- If it's a static UI, a screenshot would do. | ||
- If it's an interaction, a gif would help a lot. A good tool to make gifs is [Licecap](http://www.cockos.com/licecap/). | ||
- If it's a static UI, a screenshot will do. | ||
- If it's an interaction, a `gif` would help a lot. Goods tool to make `gif`s include [Licecap](http://www.cockos.com/licecap/), [GIPHY Capture](https://itunes.apple.com/us/app/giphy-capture-the-gif-maker/id668208984?mt=12), and [GIF Brewery](http://gifbrewery.com/). |
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.
Goods tool
, Good tools
? 😅
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.
🤦♀️
GIT_AND_GITHUB.md
Outdated
|
||
After you have merged, you should delete the branch and smile. The smile is critical | ||
part of the process, so don't forget this. | ||
After you have merged, you should delete the branch and smile. The smile is critical part of the process, so don't forget this. |
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.
…is _a_ critical part…
👍
@@ -1,23 +1,26 @@ | |||
![logo](https://raw.githubusercontent.com/bakkenbaeck/iOS-playbook/master/assets/logo-v1.png) | |||
|
|||
Don't forget to check out our favourite [suite of components and helper methods](http://github.com/usesweet), to avoid duplication of work reimplementing them yourself.. | |||
Don't forget to check out our favorite [suite of components and helper methods](http://github.com/usesweet) and the [other B&B iOS repos](https://github.com/bakkenbaeck?language=swift) to see if we've already built something to help with what you're trying to do. |
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.
Overcorrected favourite
here? 👀
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 updated all the spelling to be en-US
since I was doing most of the writing and editing and that's what I'm used to.
- [ ] Create a local folder with your project name and run `swiftplate` from there | ||
- [ ] 👶 Author: Your own name | ||
- [ ] 📫 Author email: [email protected] | ||
- [ ] 🌍 GitHub URL: https://github.com/bakkenbaeck/<YOUR_PROJECT_NAME> | ||
- [ ] 🏢 Organization Name: Bakken & Baeck | ||
- [ ] 🏢 Organization Name: Bakken & Bæck |
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.
👌🏽
REUSABLE_COMPONENTS.md
Outdated
Before shipping your component make sure that the README states what makes your Pod different than the other ones, been made by you might not be enough. It's very important that your README is :star2: fabulous :star2:. | ||
- [ ] Make sure that the README states what makes this component different than the other ones - simply having been made by us is probably not enough. It's very important that your README is 🌟 fabulous 🌟. | ||
- [ ] Provide a super-simple example on how to get the component up and running. | ||
- [ ] If the component is dependent on other frameworks, explain why they're needed them and what they do. Don't assume that people know everything. |
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.
why they're needed them
that doesn't sound right 😅
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.
no it does not
STYLE_GUIDE.md
Outdated
|
||
Images should be named consistently within an app to preserve organization and developer sanity. It is strongly suggested to append the state name to images for non-default states. | ||
|
||
Images should be named in either `camelCase` or `lower_snake_case` to facilitate code generation based on the image names. Pick one and stick to it per project. |
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'd add here something along the lines of avoid using hyphens as it messes up code completion
.
- `ic_refresh` and `ic_refresh_selected` for a refresh icon and its selected state used in multiple places throughout an app | ||
- `articleNavigationBar` and `articleNavigationBarSelected` for something used in one specific place. | ||
|
||
### Localized strings |
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.
Localised
😁
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.
There are a bunch of those s/s/z/
changes. I'd really appreciate if we could keep the spelling consistent across documents (🇬🇧). 👍
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 have tried to keep this consistent within the current repo. If there's something I missed, please let me know.
|
||
Any strings visible to the user must be localized using `NSLocalizedString` or something wrapping it. It is way, way easier to set up all strings like this from the beginning than to add this feature later. | ||
|
||
Don't use the developer-language content of the string as the localized string's key, because if you do, you then have to update the copy in multiple places. |
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.
not sure I follow.
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.
Basically if you have
NSLocalizedString("Something in English", "Title of some view controller")
Your Localizable.strings
files will contain
Base.lproj
:
/* Title of some view controller */
"Something in English" = "Something in English";
es.lproj
/* Title of some view controller */
"Something in English" = "Alguna cosa en español";
So if you wind up changing the key, you have to update not just the key at the point where you're wrapping it in NSLocalized string, but you also have to update it in the Localizable.strings
in Base.lproj
and es.lproj
, times whatever number of languages you're supporting.
Otherwise, the localized string system will just return the updated key, so it'll return everywhere in English.
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.
ok I get what you meant now 👍🏽
|
||
Don't use the developer-language content of the string as the localized string's key, because if you do, you then have to update the copy in multiple places. | ||
|
||
Use `lower_snake_case` for localized string keys to both facilitate code generation and to make it extremely obvious when there is an untranslated user-facing string, since by default if a value does not exist for a key in `Localizable.strings`, the key itself is returned. |
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.
There should be a way to know the key is missing when compiling. 😭
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 wrote a test helper for this years ago https://github.com/designatednerd/DNSiOSLocalizationTestHelpers - it would certainly be nice to know at compile time though
|
||
## Linting | ||
|
||
For code lint we use [SwiftLint](https://github.com/realm/SwiftLint). Our current `.swiftlint.yml` file is available [here](default.swiftlint.yml). |
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.
Does this point to the local file? I'm not sure how markdown links inside github work.
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.
yes
@elland Anything further you'd like me to address? |
GIT_AND_GITHUB.md
Outdated
a fix? Well, if you find a bug in a previous release, you can just, checkout the tag, | ||
fork it, fix it, deploy the new build, and finally, submit a PR to merge it with `master` | ||
to the sound of Daft Punk. | ||
You might be wondering: why only `master`? What if I have to rollback to apply a fix? Well, if you find a bug in a previous release, you can just, checkout the tag, fork it, fix it, deploy the new build, and finally, submit a PR to merge it with `master` to the sound of Daft Punk. | ||
|
||
Commit messages are in the [imperative present tense](http://stackoverflow.com/questions/3580013/should-i-use-past-or-present-tense-in-git-commit-messages), and have no period at the end. |
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.
note to self for tomorrow: remove this line
|
||
The physical files should be kept in sync with the Xcode project files in order to avoid file sprawl. Any Xcode groups created should be reflected by folders in the filesystem. Code should be grouped by type and feature for greater clarity. | ||
|
||
Make sure to use an [app-template](https://github.com/bakkenbaeck/app-template) for consistency. |
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.
Are we going to use this? I haven't in a long time.
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 have not since I've been on the same project since I started. In the past I have found it extremely helpful to have an app template, especially for things like "Setting up a bunch of boilerplate related to CI"
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.
We should evaluate whether the current template is up-to-date for what we need there.
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.
That would make more sense. Actually, can't we build something that integrates with Xcode anymore? So we can start the template from the new project
tab?
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.
Yes, I fought with this at a prior job. However, I think that's more of an issue for that repo than for this one. I think we should still point to a common template here.
Great work Ellen. I'm gonna merge as there is some consensus here. If there are still disagreements I suggest they be taken in a separate PR. This is a big change and I'd rather merge it in now and amend later rather than letting the PR get stale. |
Per discussion yesterday, I took a swing through the Handbook to see what could be updated and simplified.
In this PR, I:
.swiftlint.yml
file that should be usable across most projects immediately.Feedback requested:
Any other feedback is most welcome!