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: Fix any missing spaces around Boolean operators #2767

Merged
merged 2 commits into from Apr 12, 2024

Conversation

claremacrae
Copy link
Collaborator

Description

Motivation and Context

Make the parsing of Boolean filters a bit more forgiving, by adding any missing spaces around Boolean operators
This is easy to do now that we have the simplified instruction line.

Note: I will update the documentation in a separate PR.

Now

For example this line:

(path includes a)AND NOT(path includes b)

Becomes this:

(f1)AND NOT(f2)

Which Tasks now converts to this, which just works:

(f1) AND NOT (f2)

In Tasks 6.2.0 and earlier

Previously the above input line gave this error:

Tasks query: malformed boolean query -- Unexpected character: A.
A closing parenthesis should be followed by another closing parenthesis or whitespace
(check the documentation for guidelines)

How has this been tested?

  • Automated tests
  • Exploratory testing

Types of changes

Changes visible to users:

  • New feature (prefix: feat - non-breaking change which adds functionality)
  • Documentation (prefix: docs - improvements to any documentation content for users)

Internal changes:

  • Tests (prefix: test - additions and improvements to unit tests and the smoke tests)

Checklist

  • My code follows the code style of this project and passes yarn run lint.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
    • Will be done later
  • My change has adequate Unit Test coverage.

Terms

This is easy to do now that we have the simplified instruction line.

For example this line:

    (path includes a)AND NOT(path includes b)

Becomes this:

    (f1)AND NOT(f2)

Which we now convert to this, which just works:

    (f1) AND NOT (f2)
@claremacrae claremacrae added the scope: query logic Boolean combinations of filters - and, or, not label Apr 12, 2024
@claremacrae claremacrae merged commit 0c72581 into main Apr 12, 2024
2 checks passed
@claremacrae claremacrae deleted the add-missing-spaces branch April 12, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: query logic Boolean combinations of filters - and, or, not
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant