From cd3915cc91eb90515e435f079f2d6276ddbd8529 Mon Sep 17 00:00:00 2001 From: Dave Nathanael Date: Thu, 12 Mar 2020 14:18:40 +0700 Subject: [PATCH 1/3] [CHORES] Install linter --- requirements.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a3a9a58..40a1a89 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1,23 @@ appdirs==1.4.3 asgiref==3.2.3 attrs==19.3.0 -black==19.10b0 +autopep8==1.5 Click==7.0 coverage==5.0.3 dj-database-url==0.5.0 Django==3.0.1 django-cors-headers==3.2.0 +django-filter==2.2.0 djangorestframework==3.11.0 +entrypoints==0.3 factory-boy==2.12.0 Faker==4.0.1 gunicorn==20.0.4 +mccabe==0.6.1 pathspec==0.7.0 psycopg2-binary==2.8.4 +pycodestyle==2.5.0 +pyflakes==2.1.1 python-dateutil==2.8.1 python-dotenv==0.11.0 pytz==2019.3 -- GitLab From cdfd6748dc96e20ed9d87201f4dde2875818664b Mon Sep 17 00:00:00 2001 From: Dave Nathanael Date: Fri, 20 Mar 2020 20:27:31 +0700 Subject: [PATCH 2/3] [CHORES] Add linter configuration, script, and CI script --- .gitlab-ci.yml | 2 ++ lint.sh | 2 ++ setup.cfg | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 lint.sh create mode 100644 setup.cfg diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b7d8564..c8de748 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,8 @@ test: - python manage.py runserver 8000 & when: on_success script: + - echo "Starting linter" + - sh lint.sh - echo "Starting tests" - coverage erase - coverage run --include="./*/*" --omit="./env/*","./project/*","./manage.py" manage.py test apps diff --git a/lint.sh b/lint.sh new file mode 100644 index 0000000..bb5d1ea --- /dev/null +++ b/lint.sh @@ -0,0 +1,2 @@ +autopep8 -iraav apps +pycodestyle --show-source --show-pep8 apps \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..62e7381 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[pycodestyle] +max-line-length = 100 -- GitLab From 43097421bc7b161d479ef1595edb31e71973f8af Mon Sep 17 00:00:00 2001 From: Dave Nathanael Date: Fri, 20 Mar 2020 20:31:05 +0700 Subject: [PATCH 3/3] [CHORES] Refactor code with autoformatter --- apps/accounts/migrations/0001_initial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/accounts/migrations/0001_initial.py b/apps/accounts/migrations/0001_initial.py index e6e7d22..5ff1095 100644 --- a/apps/accounts/migrations/0001_initial.py +++ b/apps/accounts/migrations/0001_initial.py @@ -43,6 +43,6 @@ class Migration(migrations.Migration): ), ), ], - options={"verbose_name_plural": "accounts", "db_table": "account",}, + options={"verbose_name_plural": "accounts", "db_table": "account", }, ), ] -- GitLab