-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from valberg/add_pre_commit
Add .pre-commit-config.yaml
- Loading branch information
Showing
30 changed files
with
863 additions
and
635 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,3 @@ git-push.bat | |
.python-version | ||
.coverage | ||
/.idea/ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
default_language_version: | ||
python: python3 | ||
exclude: ^.*\b(migrations)\b.*$ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-merge-conflict | ||
- id: check-case-conflict | ||
- id: detect-private-key | ||
- id: check-added-large-files | ||
- id: check-json | ||
- id: check-symlinks | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-bugbear | ||
- flake8-comprehensions | ||
- flake8-tidy-imports | ||
args: [--max-line-length=88] | ||
- repo: https://github.com/asottile/reorder_python_imports | ||
rev: v3.0.1 | ||
hooks: | ||
- id: reorder-python-imports | ||
args: | ||
- --py37-plus | ||
- --application-directories=.:src | ||
exclude: migrations/ | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.31.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: | ||
- --py37-plus | ||
exclude: migrations/ | ||
- repo: https://github.com/adamchainz/django-upgrade | ||
rev: 1.4.0 | ||
hooks: | ||
- id: django-upgrade | ||
args: | ||
- --target-version=3.2 | ||
- repo: https://github.com/asottile/yesqa | ||
rev: v1.3.0 | ||
hooks: | ||
- id: yesqa | ||
- repo: https://github.com/asottile/add-trailing-comma | ||
rev: v2.2.1 | ||
hooks: | ||
- id: add-trailing-comma | ||
- repo: https://github.com/hadialqattan/pycln | ||
rev: v1.2.5 | ||
hooks: | ||
- id: pycln |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -346,5 +346,3 @@ x.x (yyyy-mm-dd) | |
- Template path. [bee_keeper] | ||
|
||
- Name changes. [bee_keeper] | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
from django.contrib import admin | ||
|
||
from .utils import (get_invitation_admin_add_form, | ||
get_invitation_admin_change_form, get_invitation_model) | ||
from .utils import get_invitation_admin_add_form | ||
from .utils import get_invitation_admin_change_form | ||
from .utils import get_invitation_model | ||
|
||
Invitation = get_invitation_model() | ||
InvitationAdminAddForm = get_invitation_admin_add_form() | ||
InvitationAdminChangeForm = get_invitation_admin_change_form() | ||
|
||
|
||
class InvitationAdmin(admin.ModelAdmin): | ||
list_display = ('email', 'sent', 'accepted') | ||
list_display = ("email", "sent", "accepted") | ||
raw_id_fields = ("inviter",) | ||
|
||
def get_form(self, request, obj=None, **kwargs): | ||
if obj: | ||
kwargs['form'] = InvitationAdminChangeForm | ||
kwargs["form"] = InvitationAdminChangeForm | ||
else: | ||
kwargs['form'] = InvitationAdminAddForm | ||
kwargs['form'].user = request.user | ||
kwargs['form'].request = request | ||
return super(InvitationAdmin, self).get_form(request, obj, **kwargs) | ||
kwargs["form"] = InvitationAdminAddForm | ||
kwargs["form"].user = request.user | ||
kwargs["form"].request = request | ||
return super().get_form(request, obj, **kwargs) | ||
|
||
|
||
admin.site.register(Invitation, InvitationAdmin) |
Oops, something went wrong.