Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS-163 New Java API to process files during the analysis #4706

Merged
merged 6 commits into from
May 29, 2024
Merged

Conversation

saberduck
Copy link
Contributor

Fixes JS-163

@saberduck saberduck marked this pull request as ready for review May 27, 2024 16:33
}

protected boolean isJavaScript(InputFile file) {
return inputFileLanguage(file).equals(JavaScriptLanguage.KEY);
}

abstract void analyzeFiles(List<InputFile> inputFiles, List<String> tsConfigs) throws IOException;

protected void analyzeFile(InputFile file, @Nullable List<String> tsConfigs, @Nullable TsProgram tsProgram) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job of refactoring duplicate code into this!

Comment on lines +53 to +56
@Override
public void doneAnalysis() {
consumers.forEach(JsAnalysisConsumer::doneAnalysis);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doneAnalysis() is actually never used for the consumerS, only for each consumer individually?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this IT runs both the JS and Consumer plugins and validates that the consumer plugin runs execute() if and only if once the JS plugin is done processing all the files? Is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is asserting that execute is invoked only after the analysis. The order of execution of sensors is implemented with DependsUpon/@DependedUpon annotation

Copy link
Contributor

@ilia-kebets-sonarsource ilia-kebets-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments and remarks, otherwise, LGTM!

@saberduck saberduck merged commit 01e72c2 into master May 29, 2024
24 of 25 checks passed
@saberduck saberduck deleted the JS-163 branch May 29, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants