Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

analyzer: execute rules in batches. #224

Merged
merged 1 commit into from
Jun 19, 2018
Merged

analyzer: execute rules in batches. #224

merged 1 commit into from
Jun 19, 2018

Conversation

ajnavarro
Copy link
Contributor

@ajnavarro ajnavarro commented Jun 15, 2018

  • Move all the iteration logic from Analyzer to Batch. Now Analyzer has a set of Batch objects instead of a set of Rules.
  • To be able to add custom rules, created an analyzer.Builder object. With it, you can build a custom Analyzer and add custom rules on specific Batches. This Batches can change depending on our necessities in the future.
  • Validation rules do not exist anymore. Now they are standard rules into a Batch that iterates only once.

Closes: #141

Signed-off-by: Antonio Jesus Navarro Perez antnavper@gmail.com

@ajnavarro ajnavarro changed the title [WIP] analyzer: execute rules in batches. analyzer: execute rules in batches. Jun 18, 2018
}

const debugAnalyzerKey = "DEBUG_ANALYZER"
// AddPreValidationRule adds a new rule to the analyzer begore standard validation rules.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/begore/before the

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

@mcarmonaa
Copy link
Contributor

apart of the typo, LGTM

- Move all the iteration logic from `Analyzer` to `Batch`. Now `Analyzer` has a set of Batch objects instead of a set of Rules.
- To be able to add custom rules, created an `AnalyzerBuilder` object. With it, you can build a custom `Analyzer` and add custom rules on specific Batches. This Batches can change depending on our necessities in the future.
- Validation rules do not exist anymore. Now they are standard rules into a Batch that iterates only once.

Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
@ajnavarro ajnavarro merged commit e305e62 into src-d:master Jun 19, 2018
@ajnavarro ajnavarro deleted the feature/rule-batching branch June 19, 2018 07:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants