Skip to content

Commit f9c67f0

Browse files
jdufresnecarltongibson
authored andcommitted
Clean up all whitespace throughout project (#5578)
* Remove trailing whitespace from lines * Remove trailing nad leading whitespace from files Allows for cleaner diffs in future changes. For editors that automatically clean up whitespace on save, will avoid unrelated line changes in diffs.
1 parent f8e8381 commit f9c67f0

22 files changed

+32
-36
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
MANIFEST
1414
coverage.*
1515

16+
!.editorconfig
1617
!.gitignore
1718
!.travis.yml
1819
!.isort.cfg

.tx/config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ file_filter = rest_framework/locale/<lang>/LC_MESSAGES/django.po
77
source_file = rest_framework/locale/en_US/LC_MESSAGES/django.po
88
source_lang = en_US
99
type = PO
10-

docs/api-guide/caching.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Caching
22

3-
> A certain woman had a very sharp conciousness but almost no
3+
> A certain woman had a very sharp conciousness but almost no
44
> memory ... She remembered enough to work, and she worked hard.
55
> - Lydia Davis
66
@@ -22,9 +22,9 @@ from rest_framework.views import APIView
2222
from rest_framework import viewsets
2323

2424
class UserViewSet(viewsets.Viewset):
25-
25+
2626
# Cache requested url for each user for 2 hours
27-
@method_decorator(cache_page(60*60*2))
27+
@method_decorator(cache_page(60*60*2))
2828
@method_decorator(vary_on_cookie)
2929
def list(self, request, format=None):
3030
content = {
@@ -35,7 +35,7 @@ class UserViewSet(viewsets.Viewset):
3535
class PostView(APIView):
3636

3737
# Cache page for the requested url
38-
@method_decorator(cache_page(60*60*2))
38+
@method_decorator(cache_page(60*60*2))
3939
def get(self, request, format=None):
4040
content = {
4141
'title': 'Post title',

docs/api-guide/generic-views.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ For example:
113113

114114
Note that if your API doesn't include any object level permissions, you may optionally exclude the `self.check_object_permissions`, and simply return the object from the `get_object_or_404` lookup.
115115

116-
#### `filter_queryset(self, queryset)`
116+
#### `filter_queryset(self, queryset)`
117117

118-
Given a queryset, filter it with whichever filter backends are in use, returning a new queryset.
118+
Given a queryset, filter it with whichever filter backends are in use, returning a new queryset.
119119

120-
For example:
120+
For example:
121121

122122
def filter_queryset(self, queryset):
123123
filter_backends = (CategoryFilter,)

docs/api-guide/permissions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,15 @@ If you need to test if a request is a read operation or a write operation, you s
197197
---
198198

199199
Custom permissions will raise a `PermissionDenied` exception if the test fails. To change the error message associated with the exception, implement a `message` attribute directly on your custom permission. Otherwise the `default_detail` attribute from `PermissionDenied` will be used.
200-
200+
201201
from rest_framework import permissions
202202

203203
class CustomerAccessPermission(permissions.BasePermission):
204204
message = 'Adding customers not allowed.'
205-
205+
206206
def has_permission(self, request, view):
207207
...
208-
208+
209209
## Examples
210210

211211
The following is an example of a permission class that checks the incoming request's IP address against a blacklist, and denies the request if the IP has been blacklisted.

docs/api-guide/routers.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ For example, you can append `router.urls` to a list of existing views…
5858
router = routers.SimpleRouter()
5959
router.register(r'users', UserViewSet)
6060
router.register(r'accounts', AccountViewSet)
61-
61+
6262
urlpatterns = [
6363
url(r'^forgot-password/$', ForgotPasswordFormView.as_view()),
6464
]
65-
65+
6666
urlpatterns += router.urls
6767

6868
Alternatively you can use Django's `include` function, like so…
@@ -106,10 +106,10 @@ For example, if you want to change the URL for our custom action to `^users/{pk}
106106

107107
from myapp.permissions import IsAdminOrIsSelf
108108
from rest_framework.decorators import detail_route
109-
109+
110110
class UserViewSet(ModelViewSet):
111111
...
112-
112+
113113
@detail_route(methods=['post'], permission_classes=[IsAdminOrIsSelf], url_path='change-password')
114114
def set_password(self, request, pk=None):
115115
...
@@ -124,10 +124,10 @@ For example, if you want to change the name of our custom action to `'user-chang
124124

125125
from myapp.permissions import IsAdminOrIsSelf
126126
from rest_framework.decorators import detail_route
127-
127+
128128
class UserViewSet(ModelViewSet):
129129
...
130-
130+
131131
@detail_route(methods=['post'], permission_classes=[IsAdminOrIsSelf], url_name='change-password')
132132
def set_password(self, request, pk=None):
133133
...

docs/api-guide/schemas.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,4 +784,3 @@ in [OpenAPI][open-api] format.
784784
[api-blueprint]: https://apiblueprint.org/
785785
[static-files]: https://docs.djangoproject.com/en/stable/howto/static-files/
786786
[named-arguments]: https://docs.djangoproject.com/en/stable/topics/http/urls/#named-groups
787-

docs/api-guide/validators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ It has two required arguments, and a single optional `messages` argument:
8484
The validator should be applied to *serializer classes*, like so:
8585

8686
from rest_framework.validators import UniqueTogetherValidator
87-
87+
8888
class ExampleSerializer(serializers.Serializer):
8989
# ...
9090
class Meta:

docs/topics/3.7-announcement.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<style>
32
.promo li a {
43
float: left;

0 commit comments

Comments
 (0)