Created
May 5, 2017 19:25
-
-
Save jaredlockhart/a396efe6dc651abbfa89c4a2bd9aaa89 to your computer and use it in GitHub Desktop.
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
| # How do we indent long lines | |
| # Example one | |
| # Too long | |
| fields = ('slug', 'name', 'description', 'start_date', 'end_date') | |
| # If you're just over 80 characters, you can do this, it's the simplest | |
| # form of satisfying the 80 character max | |
| fields = ( | |
| 'slug', 'name', 'description', 'start_date', 'end_date') | |
| # If you're way over 80 characters, you have to move each element to its own line like this | |
| fields = ( | |
| 'slug', | |
| 'name', | |
| 'description', | |
| 'start_date', | |
| 'end_date', # always include a trailing comma, they're legal and make refactoring easier | |
| ) | |
| # I do not like tooth brush indentation | |
| fields = ('slug', 'name', 'description', | |
| 'start_date', 'end_date') | |
| # because it makes refactoring later harder, for instance if you change the name `fields` | |
| # now you have to change the indentation on the following line, | |
| # or if you want to add a new field name or change the order of them | |
| # then you have to move every line around |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've seen people do: