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

feat/isasmendi/add scanoss.json support #17

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

isasmendiagus
Copy link

WHAT

  • Adds support for scanoss.json options:
    • remove
    • replace

@isasmendiagus isasmendiagus requested a review from eeisegn December 2, 2024 14:21
src/main/java/com/scanoss/ScannerPostProcessor.java Outdated Show resolved Hide resolved
src/main/java/com/scanoss/utils/LineRange.java Outdated Show resolved Hide resolved
src/main/java/com/scanoss/utils/LineRangeUtils.java Outdated Show resolved Hide resolved
src/main/java/com/scanoss/utils/LineRangeUtils.java Outdated Show resolved Hide resolved
src/main/java/com/scanoss/utils/LineRangeUtils.java Outdated Show resolved Hide resolved
src/main/java/com/scanoss/utils/LineRangeUtils.java Outdated Show resolved Hide resolved
src/main/java/com/scanoss/cli/ScanCommandLine.java Outdated Show resolved Hide resolved
src/main/java/com/scanoss/cli/ScanCommandLine.java Outdated Show resolved Hide resolved
src/main/java/com/scanoss/settings/Settings.java Outdated Show resolved Hide resolved
@isasmendiagus isasmendiagus force-pushed the feat/isasmendi/add-scanoss.json-support branch from a751c3e to e297bac Compare January 3, 2025 07:26

return rules.stream()
.filter(rule -> isMatchingRule(result, rule))
.anyMatch(rule -> {
Copy link
Author

Choose a reason for hiding this comment

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

@eeisegn anyMatch is a short circuit operation, the first match returns true and stops the iteration

private boolean isRemoveLineRangeMatch(@NonNull RemoveRule rule, @NonNull ScanFileResult result) {
LineRange ruleLineRange = new LineRange(rule.getStartLine(), rule.getEndLine());

String lines = result.getFileDetails().get(0).getLines();
Copy link
Author

Choose a reason for hiding this comment

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

@eeisegn Validation here is not necessary.
Invalid results are skipped upstream within hasInvalidStructure()

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