Stop using print statments or root level loggers

This commit is contained in:
Julian Stirling 2025-09-18 14:30:44 +01:00
parent 338d49f9e6
commit 65f172d650
9 changed files with 69 additions and 52 deletions

View file

@ -114,8 +114,8 @@ select = [
"C", # Flake8 comprehensions
"FIX", #TODO/FIXME's in code. These should be added during development for ongoing tasks.
# If they are not fixed before merge they should be converted to GitLab issues
# "LOG", # Flake8 logging issues (pedantic logger formatting issues can be added with "G")
# "T20", # Warns for print statements, production code should log
"LOG", # Flake8 logging issues (pedantic logger formatting issues can be added with "G")
"T20", # Warns for print statements, production code should log
# "PT", # pytest linting
"RET", # Consistent clear return statements
"RSE", # Raise parentheses
@ -140,10 +140,17 @@ ignore = [
]
[tool.ruff.lint.per-file-ignores]
# All testing dirs
"{tests,integration-tests,hardware-specific-tests}/**" = [
"B018", # Complaining about useless attribute access in tests, but we need them to check errors are raised
"ANN", # Tests are not typehinted for fixtures etc
"S101", # Allow asserts in tests
"T20", # Allow prints in tests
"LOG015",# Allow tests to use the root logger.
]
# Developer CLI scripts
"{pull_webapp,picamera_tests,change_log_helper}.py" = [
"T20", # Printing is normal in small CLI scripts
]
[tool.ruff.lint.pydocstyle]