From 36bc99e4ec853d42c6f62c648ab73a2c6bc48a1e Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Fri, 2 Feb 2024 15:47:48 -0500 Subject: [PATCH] Support removing HHAST async fixmes --- src/analyzer/function_analysis_data.rs | 3 --- tests/remove-unused-fixmes/removeHHASTFixme/input.hack | 5 +++-- tests/remove-unused-fixmes/removeHHASTFixme/output.txt | 2 +- tests/remove-unused-fixmes/removeHakanaFixme/input.hack | 3 +++ tests/remove-unused-fixmes/removeHakanaFixme/output.txt | 3 +++ 5 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 tests/remove-unused-fixmes/removeHakanaFixme/input.hack create mode 100644 tests/remove-unused-fixmes/removeHakanaFixme/output.txt diff --git a/src/analyzer/function_analysis_data.rs b/src/analyzer/function_analysis_data.rs index 9f8a5636..4981b072 100644 --- a/src/analyzer/function_analysis_data.rs +++ b/src/analyzer/function_analysis_data.rs @@ -527,9 +527,6 @@ impl FunctionAnalysisData { for hakana_fixme_or_ignores in &self.hakana_fixme_or_ignores { for line_issue in hakana_fixme_or_ignores.1 { - if line_issue.0 == IssueKind::NoJoinInAsyncFunction { - continue; - } if !self .matched_ignore_positions .contains(&(line_issue.1 .0, line_issue.1 .1)) diff --git a/tests/remove-unused-fixmes/removeHHASTFixme/input.hack b/tests/remove-unused-fixmes/removeHHASTFixme/input.hack index bf8b5716..8e682611 100644 --- a/tests/remove-unused-fixmes/removeHHASTFixme/input.hack +++ b/tests/remove-unused-fixmes/removeHHASTFixme/input.hack @@ -1,3 +1,4 @@ -function foo(): void { - echo(/* HAKANA_FIXME[NoValue] */ 5); +async function foo(): Awaitable { + /* HHAST_FIXME[NoJoinInAsyncFunction] */ + echo(5); } \ No newline at end of file diff --git a/tests/remove-unused-fixmes/removeHHASTFixme/output.txt b/tests/remove-unused-fixmes/removeHHASTFixme/output.txt index e4743323..f72273d7 100644 --- a/tests/remove-unused-fixmes/removeHHASTFixme/output.txt +++ b/tests/remove-unused-fixmes/removeHHASTFixme/output.txt @@ -1,3 +1,3 @@ -function foo(): void { +async function foo(): Awaitable { echo(5); } \ No newline at end of file diff --git a/tests/remove-unused-fixmes/removeHakanaFixme/input.hack b/tests/remove-unused-fixmes/removeHakanaFixme/input.hack new file mode 100644 index 00000000..bf8b5716 --- /dev/null +++ b/tests/remove-unused-fixmes/removeHakanaFixme/input.hack @@ -0,0 +1,3 @@ +function foo(): void { + echo(/* HAKANA_FIXME[NoValue] */ 5); +} \ No newline at end of file diff --git a/tests/remove-unused-fixmes/removeHakanaFixme/output.txt b/tests/remove-unused-fixmes/removeHakanaFixme/output.txt new file mode 100644 index 00000000..e4743323 --- /dev/null +++ b/tests/remove-unused-fixmes/removeHakanaFixme/output.txt @@ -0,0 +1,3 @@ +function foo(): void { + echo(5); +} \ No newline at end of file