-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow for the Specification of Either XPath Version 1 or XPath Version 2 When Running Checks #15
Comments
FIXME: add finley to this |
Myself (@Finley8), @gyamfi01, and I reviewed the
|
@Finley8 (Me), @gyamfi01, and @KevenDuverglas researched Xpath 1 and 2 expressions. We focused on the relations of syntax and nodes within XPath expressions. We have searched through the |
1 similar comment
@Finley8 (Me), @gyamfi01, and @KevenDuverglas researched Xpath 1 and 2 expressions. We focused on the relations of syntax and nodes within XPath expressions. We have searched through the |
To answer question 1, XPath 2 introduced a lot of additional features and improvements like more data types, higher order funtions, and more built in-functions. With these new implementations, Xpath 2 is able to write and evaluate more complex expressions that cant be written in XPath 1. These features may result in a slower runtime for XPath 2 compared to Xpath 1. |
@VitalJoseph, @Finley8, @KevenDuverglas, and @gyamfi01 Did research and tested the xpath1 on chasten and we discovered to the best of our knowledge that the
|
For differences between XPath versions: https://stackoverflow.com/questions/51374344/what-are-the-differences-between-versions-of-xpath-1-0-2-0-3-1 |
Just dropping this here for reference: within the file you mentioned, you can specify XPath version here |
@KevenDuverglas @Finley8 @VitalJoseph @gyamfi01 Is there any kind of feature branch with what's been done so far for this issue? If not, let's make one as soon as we can and we'll start messing with the config schema for starters. @ me when you can. |
While running chasten we came upon an error where you are unable to see new command line interfaces unless you run |
The current implementation of
chasten
is hard-coded so that it only works withXPath 2 expressions. While this is nice because of the fact that it supports the
greatest range of XPath expressions, it is likely going to make the execution of
XPath expressions slower when they would work sufficiently well with the version
1 system instead of the version 2 system.
There are some more details about this issue at:
https://github.com/spookylukey/pyastgrep
One idea would be that
chasten analyze
could accept a command line argumentthat would support the specification of whether or not the tool should use XPath
1 or XPath 2 to run all of the expressions associated with the checks.
Alternatively, it might be a good idea to allow the person who writes the
checks.yml
file to use an extra attribute to specify whether a certain checkshould use the XPath version 1 or version 2 parse.
The text was updated successfully, but these errors were encountered: