Merge "Enable logging related ruff checks"
This commit is contained in:
@@ -81,7 +81,7 @@ def prepare():
|
||||
LOG.info("List of Oslo Logging configuration options and current values")
|
||||
LOG.info("=" * 80)
|
||||
for c in CONF:
|
||||
LOG.info(f"{c} = {CONF[c]}")
|
||||
LOG.info("%s = %s", c, str(CONF[c]))
|
||||
LOG.info("=" * 80)
|
||||
|
||||
# Required setup based on configuration and domain
|
||||
|
||||
@@ -154,7 +154,7 @@ class ColorHandler(_StreamHandler):
|
||||
logging.DEBUG: '\033[00;32m', # GREEN
|
||||
logging.INFO: '\033[00;36m', # CYAN
|
||||
_AUDIT: '\033[01;36m', # BOLD CYAN
|
||||
logging.WARN: '\033[01;33m', # BOLD YELLOW
|
||||
logging.WARNING: '\033[01;33m', # BOLD YELLOW
|
||||
logging.ERROR: '\033[01;31m', # BOLD RED
|
||||
logging.CRITICAL: '\033[01;31m', # BOLD RED
|
||||
}
|
||||
|
||||
@@ -1154,7 +1154,7 @@ class FancyRecordTestCase(LogTestBase):
|
||||
|
||||
def _validate_keys(self, ctxt, keyed_log_string):
|
||||
infocolor = handlers.ColorHandler.LEVEL_COLORS[logging.INFO]
|
||||
warncolor = handlers.ColorHandler.LEVEL_COLORS[logging.WARN]
|
||||
warncolor = handlers.ColorHandler.LEVEL_COLORS[logging.WARNING]
|
||||
info_msg = 'info'
|
||||
warn_msg = 'warn'
|
||||
infoexpected = f"{infocolor} {keyed_log_string} {info_msg}"
|
||||
|
||||
@@ -72,7 +72,7 @@ quote-style = "preserve"
|
||||
docstring-code-format = true
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E4", "E5", "E7", "E9", "F", "S", "UP"]
|
||||
select = ["E4", "E5", "E7", "E9", "F", "G", "LOG", "S", "UP"]
|
||||
ignore = [
|
||||
"UP031", # we want to test printf-style formatting
|
||||
"S101", # assertions are only used for type narrowing
|
||||
|
||||
Reference in New Issue
Block a user