Skip to content

Commit

Permalink
Fix some pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroLQueiroz committed Nov 2, 2023
1 parent d971ce4 commit 87f82f8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ repos:
name: pylint
entry: poetry run pylint
language: system
types: [python]
args: ["--rcfile", "pyproject.toml"]
args: ["--rcfile=pyproject.toml"]
exclude: "migrations"

- repo: https://github.com/PyCQA/bandit
Expand Down
4 changes: 2 additions & 2 deletions notifications/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def get_queryset(self, request: HttpRequest):
return qs.prefetch_related("actor")

@admin.action(description=gettext_lazy("Mark selected notifications as unread"))
def mark_unread(self, request: HttpRequest, queryset: NotificationQuerySet):
def mark_unread(self, request: HttpRequest, queryset: NotificationQuerySet): # pylint: disable=unused-argument
queryset.update(unread=True)

@admin.action(description=gettext_lazy("Mark selected notifications as read"))
def mark_read(self, request: HttpRequest, queryset: NotificationQuerySet):
def mark_read(self, request: HttpRequest, queryset: NotificationQuerySet): # pylint: disable=unused-argument
queryset.update(unread=False)
1 change: 0 additions & 1 deletion notifications/models/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# pylint: disable=too-many-lines
import datetime

from django.conf import settings
Expand Down
2 changes: 1 addition & 1 deletion notifications/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def reload(self):
notification_settings = NotificationSettings(NOTIFICATION_DEFAULTS)


def reload_notification_settings(*args: Any, **kwargs: Any):
def reload_notification_settings(*args: Any, **kwargs: Any): # pylint: disable=unused-argument
setting = kwargs["setting"]
if setting == "DJANGO_NOTIFICATIONS_CONFIG":
notification_settings.reload()
Expand Down
2 changes: 1 addition & 1 deletion notifications/templatetags/notifications_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def has_notification(user):
# Requires vanilla-js framework - http://vanilla-js.com/
@register.simple_tag
def register_notify_callbacks(
badge_class="live_notify_badge", # pylint: disable=too-many-arguments,missing-docstring
badge_class="live_notify_badge",
menu_class="live_notify_list",
refresh_period=15,
callbacks="",
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,19 @@ ignore = [
]
jobs = 0
django-settings-module = "notifications.settings"
fail-on=[
"useless-suppression",
]

[tool.pylint.DESIGN]
max-locals = 20
max-args = 10
max-parents = 10

[tool.pylint.'MESSAGES CONTROL']
enable = [
"useless-suppression",
]
disable = [
"missing-function-docstring",
"missing-class-docstring",
Expand Down

0 comments on commit 87f82f8

Please sign in to comment.