2020class RelativePathLogRecord (LogRecord ):
2121 """Extended LogRecord that adds a relpath attribute for relative paths."""
2222
23- def __init__ (self , * args , ** kwargs ) -> None : # noqa: D107 ANN002 ANN003
23+ def __init__ (self , * args , ** kwargs ) -> None : # noqa: D107 ANN002 ANN003
2424 super ().__init__ (* args , ** kwargs )
25- workspace_path = os .getcwd () # noqa: PTH109
25+ workspace_path = os .getcwd () # noqa: PTH109
2626 try :
2727 # Convert pathname to a relative path from workspace root
2828 if hasattr (self , "pathname" ) and self .pathname .startswith (workspace_path ):
@@ -36,23 +36,34 @@ def __init__(self, *args, **kwargs) -> None: # noqa: D107 ANN002 ANN003
3636class RelativePathFilter (Filter ):
3737 """Filter that ensures the relpath attribute is available."""
3838
39- def filter (self , record ) -> bool : # noqa: D102 ARG002 ANN001
39+ def filter (self , record ) -> bool : # noqa: D102 ARG002 ANN001
4040 return True
4141
4242
4343class RelativePathLoggerFactory (getLoggerClass ()):
4444 """Custom logger class that uses RelativePathLogRecord."""
4545
46- def makeRecord ( # noqa: PLR0913 N802
46+ # ruff: noqa
47+ def makeRecord (
4748 self ,
48- name , level , fn , lno , msg , args , exc_info , # noqa: ANN001
49- func = None , extra = None , sinfo = None , # noqa: ANN001 ARG002
49+ name ,
50+ level ,
51+ fn ,
52+ lno ,
53+ msg ,
54+ args ,
55+ exc_info ,
56+ func = None ,
57+ extra = None ,
58+ sinfo = None ,
5059 ) -> RelativePathLogRecord :
5160 """Create a RelativePathLogRecord."""
5261 return RelativePathLogRecord (
5362 name , level , fn , lno , msg , args , exc_info , func , sinfo
5463 )
5564
65+ # ruff: enable
66+
5667
5768def setup_logging () -> None : # noqa: D103
5869 global logger_config_loaded # noqa: PLW0603
0 commit comments