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

fix: Allow spaces after show and hide - and improve error message #3213

Merged
merged 31 commits into from
Dec 1, 2024

Conversation

claremacrae
Copy link
Collaborator

Types of changes

Changes visible to users:

  • Bug fix (prefix: fix - non-breaking change which fixes an issue)

Internal changes:

  • Refactor (prefix: refactor - non-breaking change which only improves the design or structure of existing code, and making no changes to its external behaviour)
  • Tests (prefix: test - additions and improvements to unit tests and the smoke tests)

Description

Some refactorings of the Query class.

Mainly this moves a big switch statement in parseHideOptions() to functions in the relevant classes QueryLayoutOptions and TaskLayoutOptions.

It ended up with two observable changes to users, hence I am labelling this as a bug fix:

  • multiple spaces are now allowed in instructions like show tree
  • If using an invalid option on show or hide the error message is a bit more specific, and could be extended in future to list the allowed values.

Motivation and Context

My original goal was to clean up Query somewhat.

The main benefit is no longer needing to remember to add new options to Query.hideOptionsRegexp, which has tripped me up many times.

How has this been tested?

  • Automated tests
  • Exploratory testing

Checklist

  • My code follows the code style of this project and passes yarn run lint.
  • My change has adequate Unit Test coverage.

Terms

… RegEx

This makes parsing of show/hide instructions a little more relaxed,
in that multiple spaces after show/hide are now permitted.
@claremacrae claremacrae added the scope: show/hide The show and hide instructions in Tasks query blocks label Dec 1, 2024
Copy link

sonarqubecloud bot commented Dec 1, 2024

@claremacrae claremacrae merged commit 4483c27 into main Dec 1, 2024
3 checks passed
@claremacrae claremacrae deleted the refactor-query-code branch December 1, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: show/hide The show and hide instructions in Tasks query blocks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant