Run checker on inline code string and return violations. Default path uses a fake absolute path containing /src/fl/ to pass the should_process_file filter.
(code: str, path: str = "/project/src/fl/test.h")
| 13 | |
| 14 | |
| 15 | def _check(code: str, path: str = "/project/src/fl/test.h") -> list[tuple[int, str]]: |
| 16 | """Run checker on inline code string and return violations. |
| 17 | |
| 18 | Default path uses a fake absolute path containing /src/fl/ to pass |
| 19 | the should_process_file filter. |
| 20 | """ |
| 21 | checker = BareUsingChecker() |
| 22 | fc = FileContent(path=path, content=code, lines=code.splitlines()) |
| 23 | if not checker.should_process_file(path): |
| 24 | return [] |
| 25 | checker.check_file_content(fc) |
| 26 | return checker.violations.get(path, []) |
| 27 | |
| 28 | |
| 29 | class TestBareUsingCheckerLogic(unittest.TestCase): |
no test coverage detected