3
0
Fork 0

fix: explicitly disable 'duplicate-code' false alarm

so we can keep default config for that checker
This commit is contained in:
Lance Edgar 2025-09-01 19:38:57 -05:00
parent 96eb8f4356
commit 7b7fb6d7b8
3 changed files with 7 additions and 5 deletions

View file

@ -1,8 +1,4 @@
# -*- mode: conf; -*-
[MESSAGES CONTROL]
disable=fixme,
[SIMILARITIES]
# nb. cuts out some noise for duplicate-code
min-similarity-lines=5
disable=fixme

View file

@ -634,6 +634,7 @@ class FileDownload(colander.String):
name/size is shown with no hyperlink.
"""
# pylint: disable=duplicate-code
def __init__(self, request, *args, **kwargs):
self.url = kwargs.pop("url", None)
super().__init__(*args, **kwargs)
@ -641,6 +642,8 @@ class FileDownload(colander.String):
self.config = self.request.wutta_config
self.app = self.config.get_app()
# pylint: enable=duplicate-code
def widget_maker(self, **kwargs): # pylint: disable=empty-docstring
""" """
kwargs.setdefault("url", self.url)

View file

@ -321,6 +321,7 @@ class FileDownloadWidget(Widget): # pylint: disable=abstract-method
readonly_template = "readonly/filedownload"
# pylint: disable=duplicate-code
def __init__(self, request, *args, **kwargs):
self.url = kwargs.pop("url", None)
super().__init__(*args, **kwargs)
@ -328,6 +329,8 @@ class FileDownloadWidget(Widget): # pylint: disable=abstract-method
self.config = self.request.wutta_config
self.app = self.config.get_app()
# pylint: enable=duplicate-code
def serialize(self, field, cstruct, **kw): # pylint: disable=empty-docstring
""" """
# nb. readonly is the only way this rolls