Return the more user-friendly information about the location of a warning, or None.
(self, config: Config)
| 296 | count_towards_summary: ClassVar = True |
| 297 | |
| 298 | def get_location(self, config: Config) -> Optional[str]: |
| 299 | """Return the more user-friendly information about the location of a warning, or None.""" |
| 300 | if self.nodeid: |
| 301 | return self.nodeid |
| 302 | if self.fslocation: |
| 303 | filename, linenum = self.fslocation |
| 304 | relpath = bestrelpath(config.invocation_params.dir, absolutepath(filename)) |
| 305 | return f"{relpath}:{linenum}" |
| 306 | return None |
| 307 | |
| 308 | |
| 309 | @final |
no test coverage detected