Fix some pylint issues

This commit is contained in:
Alvaro Mariano 2023-11-01 22:09:35 -03:00
parent d971ce44e8
commit 87f82f89fd
6 changed files with 11 additions and 7 deletions

View file

@ -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

View file

@ -28,9 +28,9 @@ class NotificationAdmin(admin.ModelAdmin):
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)

View file

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# pylint: disable=too-many-lines
import datetime
from django.conf import settings

View file

@ -76,7 +76,7 @@ class NotificationSettings:
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()

View file

@ -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="",

View file

@ -118,6 +118,9 @@ ignore = [
]
jobs = 0
django-settings-module = "notifications.settings"
fail-on=[
"useless-suppression",
]
[tool.pylint.DESIGN]
max-locals = 20
@ -125,6 +128,9 @@ max-args = 10
max-parents = 10
[tool.pylint.'MESSAGES CONTROL']
enable = [
"useless-suppression",
]
disable = [
"missing-function-docstring",
"missing-class-docstring",