Add end-of-file-fixer hook to pre-commit (#668)

This commit is contained in:
Petter Friberg
2021-07-11 23:48:36 +02:00
committed by GitHub
parent 446589e133
commit cc5d363cfa
8 changed files with 4 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ repos:
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
- id: debug-statements - id: debug-statements
- id: check-merge-conflict - id: check-merge-conflict
- id: end-of-file-fixer
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.20.0 rev: v2.20.0
hooks: hooks:

View File

@@ -1 +0,0 @@

View File

@@ -14,4 +14,4 @@ then
fi fi
else else
echo "git working tree is not clean, aborting" echo "git working tree is not clean, aborting"
fi fi

View File

@@ -25,4 +25,3 @@
@non_atomic_requests @non_atomic_requests
def view_func(request: HttpRequest, arg: str) -> HttpResponse: ... def view_func(request: HttpRequest, arg: str) -> HttpResponse: ...
reveal_type(view_func) # N: Revealed type is "def (request: django.http.request.HttpRequest, arg: builtins.str) -> django.http.response.HttpResponse" reveal_type(view_func) # N: Revealed type is "def (request: django.http.request.HttpRequest, arg: builtins.str) -> django.http.response.HttpResponse"

View File

@@ -253,4 +253,4 @@
class User(models.Model): class User(models.Model):
username = models.TextField() username = models.TextField()
username2 = models.TextField() username2 = models.TextField()
age = models.IntegerField() age = models.IntegerField()

View File

@@ -8,4 +8,3 @@
models.Index("foo", name="test", opclasses=["bar"]) models.Index("foo", name="test", opclasses=["bar"])
models.Index("foo", name="test", condition=models.Q(foo=1)) models.Index("foo", name="test", condition=models.Q(foo=1))
models.Index("foo", name="test", include=["bar"]) models.Index("foo", name="test", include=["bar"])

View File

@@ -254,4 +254,4 @@
def base_init(cls) -> 'AbstractModel': def base_init(cls) -> 'AbstractModel':
return cls(text='mytext') return cls(text='mytext')
class MyModel(AbstractModel): class MyModel(AbstractModel):
pass pass

View File

@@ -69,4 +69,3 @@
reveal_type(request.user) # N: Revealed type is "django.contrib.auth.models.User" reveal_type(request.user) # N: Revealed type is "django.contrib.auth.models.User"
custom_settings: | custom_settings: |
INSTALLED_APPS = ('django.contrib.contenttypes', 'django.contrib.auth') INSTALLED_APPS = ('django.contrib.contenttypes', 'django.contrib.auth')