enable flake8 logging checks in ruff

Enable flake8-logging and flake8-logging-format checks to ensure we use
the correct logging style.

Change-Id: Ic4e38d31955412a3b8cf5810d8e75d0ce8178881
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
This commit is contained in:
Doug Goldstein 2024-12-04 14:40:55 -06:00
parent 982647d99b
commit 27434e48e4
No known key found for this signature in database
3 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,8 @@ ignore = ["D001"]
select = [ select = [
"E", # pycodestyle (error) "E", # pycodestyle (error)
"F", # pyflakes "F", # pyflakes
"G", # flake8-logging-format
"LOG", # flake8-logging
"S", # flake8-bandit "S", # flake8-bandit
] ]

View File

@ -103,7 +103,7 @@ class Field(object):
logging.warning( logging.warning(
'Applying default "%s" on required, but missing ' 'Applying default "%s" on required, but missing '
'attribute "%s"' % (self._default, path)) 'attribute "%s"', self._default, path)
# Do not run the adapter on the default value # Do not run the adapter on the default value
return self._default return self._default

View File

@ -269,8 +269,8 @@ class MessageRegistryFileTestCase(base.TestCase):
self.reg_file._parse_attributes(self.json_doc) self.reg_file._parse_attributes(self.json_doc)
self.assertEqual('UNKNOWN.0.0', self.reg_file.registry) self.assertEqual('UNKNOWN.0.0', self.reg_file.registry)
mock_log.assert_called_with( mock_log.assert_called_with(
'Applying default "UNKNOWN.0.0" on required, but missing ' 'Applying default "%s" on required, but missing '
'attribute "[\'Registry\']"') 'attribute "%s"', 'UNKNOWN.0.0', ['Registry'])
class BiosRegistryTestCase(base.TestCase): class BiosRegistryTestCase(base.TestCase):