Skip to content

Commit

Permalink
Merge pull request #9 from mattwang44/adopt-flake8
Browse files Browse the repository at this point in the history
Adopt flake8
  • Loading branch information
mattwang44 authored Feb 22, 2022
2 parents 9a36f4c + 539c689 commit 14c7644
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max_line_length = 120
exclude = .git,__pycache__,setup.py,registry/migrations
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ jobs:

- name: Install project dependencies
run: poetry install

- name: Run flake8
run: poetry run flake8
92 changes: 91 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ python = "^3.6"
Django = "^3"

[tool.poetry.dev-dependencies]
flake8 = "^4.0.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion registry/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib import admin
from .models import Entry

# Register your models here.

@admin.register(Entry)
class EntryAdmin(admin.ModelAdmin):
list_display = ('key', 'value', 'type', 'enabled', 'comment', )
Expand Down
1 change: 1 addition & 0 deletions registry/helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .models import Entry


class Meta(type):
def __getitem__(self, key):
try:
Expand Down
2 changes: 0 additions & 2 deletions registry/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django.utils.translation import gettext_lazy as _


# Create your models here.
class Entry(models.Model):
class Types:
STRING = 'str'
Expand Down Expand Up @@ -46,6 +45,5 @@ def clean(self):
except ValueError:
raise ValidationError({'value': _('Invalid value of the specified type.')})


class Meta:
verbose_name_plural = 'entries'
2 changes: 1 addition & 1 deletion registry/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.test import TestCase
# from django.test import TestCase

# Create your tests here.
2 changes: 1 addition & 1 deletion registry/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.shortcuts import render
# from django.shortcuts import render

# Create your views here.

0 comments on commit 14c7644

Please sign in to comment.