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

Filter out blank lines and comments in a multi-line transformations #4357

Merged
merged 2 commits into from
Sep 7, 2024

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Aug 19, 2024

This allows users to insert comments inbetween transformations in a multi-line / chained (or even a single transformation).

e.g.

# Extract value only if it's two digits of more
REGEX(\d{2,})

@jimtng jimtng requested a review from a team as a code owner August 19, 2024 10:43
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/syntax-for-binding-transformations/157861/1

@rkoshak
Copy link

rkoshak commented Aug 19, 2024

Given that JSON doesn't support comments do these comments survive the conversion between JSON to YAML and back to
JSON for managed configs?

@jimtng
Copy link
Contributor Author

jimtng commented Aug 21, 2024

Yes, the comments will survive the json/yaml conversions, because they are part of the actual configuration data.

Copy link
Member

@holgerfriedrich holgerfriedrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Did you consider extending the tests in ChannelTransformationTest.java?

@jimtng jimtng force-pushed the channeltransformation-comments branch from a019111 to 5220147 Compare September 6, 2024 23:50
Copy link
Member

@holgerfriedrich holgerfriedrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@holgerfriedrich holgerfriedrich merged commit 5cf91cd into openhab:main Sep 7, 2024
5 checks passed
@holgerfriedrich holgerfriedrich added the enhancement An enhancement or new feature of the Core label Sep 7, 2024
@holgerfriedrich holgerfriedrich added this to the 4.3 milestone Sep 7, 2024
@jimtng jimtng deleted the channeltransformation-comments branch September 7, 2024 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants