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

Use varargs for And/Or rule. #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tomarus
Copy link

@tomarus tomarus commented Apr 1, 2021

This changes the And & Or rules to variadic functions and AFAIK it has no side effect and it's backwards compatible.

This optimizes indentation for larger rules.

Before:

entry := And(
    &PositionNewRule{},
    And(
        &ToTheMoonIndicator{},
        And(
            &UnderIndicatorRule{moonRotation, NewConstantIndicator(90)},
            &HasProfitRule{},
        )
    }
)

After:

entry := And(
    &PositionNewRule{},
    &ToTheMoonIndicator{},
    &UnderIndicatorRule{moonRotation, NewConstantIndicator(90)},
    &HasProfitRule{},
)

@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #41 (279ca3a) into main (572c478) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   98.36%   98.37%   +0.01%     
==========================================
  Files          42       42              
  Lines         611      615       +4     
==========================================
+ Hits          601      605       +4     
  Misses          7        7              
  Partials        3        3              
Impacted Files Coverage Δ
rule.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 572c478...279ca3a. Read the comment docs.

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.

1 participant