Skip to content

Commit

Permalink
chore: cookiecutter cleanup
Browse files Browse the repository at this point in the history
This commit

* Runs black over all the project files
* extends .pre-commit-config.yaml
* adds .gitlint
* removes .travis.yml and .gitlab-ci.yml
  • Loading branch information
open-dynaMIX committed Jun 29, 2020
1 parent 4848e5e commit 7dfcdc3
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 103 deletions.
40 changes: 0 additions & 40 deletions .gitlab-ci.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[general]
ignore=body-is-missing, body-max-line-length, body-min-length
39 changes: 24 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
repos:
- repo: local
hooks:
- id: black
name: black
language: system
entry: black
types: [python]
- id: isort
name: isort
language: system
entry: isort -y
types: [python]
- id: flake8
name: flake8
language: system
entry: flake8
types: [python]
- id: black
stages: [commit]
name: black
language: system
entry: black
types: [python]
- id: isort
stages: [commit]
name: isort
language: system
entry: isort -y
types: [python]
- id: flake8
stages: [commit]
name: flake8
language: system
entry: flake8
types: [python]
- id: gitlint
stages: [commit-msg]
name: gitlint
description: Validate commit lint
entry: gitlint --msg-filename
language: system
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

6 changes: 1 addition & 5 deletions alexandria/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ def register_module(module):
register(obj, base_name)


register_module(
importlib.import_module(
".core.factories", "alexandria"
)
)
register_module(importlib.import_module(".core.factories", "alexandria"))


@pytest.fixture
Expand Down
4 changes: 1 addition & 3 deletions alexandria/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ def default(default_dev=env.NOTSET, default_prod=env.NOTSET):
),
"NAME": env.str("DATABASE_NAME", default="alexandria"),
"USER": env.str("DATABASE_USER", default="alexandria"),
"PASSWORD": env.str(
"DATABASE_PASSWORD", default=default("alexandria")
),
"PASSWORD": env.str("DATABASE_PASSWORD", default=default("alexandria")),
"HOST": env.str("DATABASE_HOST", default="localhost"),
"PORT": env.str("DATABASE_PORT", default=""),
"OPTIONS": env.dict("DATABASE_OPTIONS", default={}),
Expand Down
5 changes: 1 addition & 4 deletions alexandria/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@
urlpatterns = [
path("api-token-auth/", TokenObtainPairView.as_view(), name="login"),
path("api-token-refresh/", TokenRefreshView.as_view(), name="refresh"),
path(
"api/v1/",
include("alexandria.core.urls"),
),
path("api/v1/", include("alexandria.core.urls"),),
]
4 changes: 1 addition & 3 deletions alexandria/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "alexandria.settings"
)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "alexandria.settings")

application = get_wsgi_application()
4 changes: 1 addition & 3 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
import sys

if __name__ == "__main__":
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "alexandria.settings"
)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "alexandria.settings")
from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ flake8-docstrings==1.5.0
flake8-isort==2.9.1
flake8-string-format==0.3.0
flake8-tuple==0.4.1
gitlint==0.13.1
isort==4.3.21
pdbpp==0.10.2
pytest==5.4.1
Expand Down

0 comments on commit 7dfcdc3

Please sign in to comment.