def test_streaming_output_failure() -> None: results = EnrichedLintResults([LintResult(18, "stdout", "stderr")], linter_name="linter") assert results.level() == LogLevel.WARN assert results.message() == dedent("""\ linter failed (exit code 18). stdout stderr """)
def test_streaming_output_success() -> None: results = EnrichedLintResults([LintResult(0, "stdout", "stderr")], linter_name="linter") assert results.level() == LogLevel.INFO assert results.message() == dedent("""\ linter succeeded. stdout stderr """)
def test_streaming_output_partitions() -> None: results = EnrichedLintResults( [ LintResult(21, "", "", partition_description="ghc8.1"), LintResult(0, "stdout", "stderr", partition_description="ghc9.2"), ], linter_name="linter", ) assert results.level() == LogLevel.WARN assert results.message() == dedent("""\ linter failed (exit code 21). Partition #1 - ghc8.1: Partition #2 - ghc9.2: stdout stderr """)
def lint_results(self) -> EnrichedLintResults: return EnrichedLintResults([], linter_name="SkippedLinter")
def lint_results(self) -> EnrichedLintResults: addresses = [config.address for config in self.field_sets] return EnrichedLintResults( [LintResult(self.exit_code(addresses), "", "", report=None)], linter_name=self.linter_name, )
def test_streaming_output_skip() -> None: results = EnrichedLintResults([], linter_name="linter") assert results.level() == LogLevel.DEBUG assert results.message() == "linter skipped."