Return the more user-friendly information about the location of a warning, or None.
(self, config: Config)
| 365 | count_towards_summary: ClassVar = True |
| 366 | |
| 367 | def get_location(self, config: Config) -> str | None: |
| 368 | """Return the more user-friendly information about the location of a warning, or None.""" |
| 369 | if self.nodeid: |
| 370 | return self.nodeid |
| 371 | if self.fslocation: |
| 372 | filename, linenum = self.fslocation |
| 373 | relpath = bestrelpath(config.invocation_params.dir, absolutepath(filename)) |
| 374 | return f"{relpath}:{linenum}" |
| 375 | return None |
| 376 | |
| 377 | |
| 378 | @final |
no test coverage detected