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
Multi-line rules #29
Comments
Hi @langston-barrett , Thanks for raising! filter_by:
description: Use SQLAlchemy's filter_by for concision
expr:
//Call[ ./func/Attribute[ @attr='filter'
and ./value/Call[./func/Attribute[@attr='query']
and ./args[count(child::*) = 1]]
]
and ./args[count(child::*) = 1]
and ./args/Compare[ ./ops/Eq
and ./left/Attribute[ @attr != 'attributes'
and ./value/Name
]
]
]
example: |
session.query(Model).filter(Model.attr == baz)
instead: |
session.query(Model).filter_by(attr = baz)
settings: *all_files and have it work (or, at least, this is how I typically format my
|
@hchasestevens Thanks for the quick reply! That works perfectly. Feel free to keep open if you feel like supporting YAML multi-line string syntax, but I'm satisfied as long as I can write the rules readably. |
Bellybutton doesn't like this:
it says:
It works fine if you inline
expr
, but this is a pain becauseexpr
is huge:This is version 0.3.0.
The text was updated successfully, but these errors were encountered: