Skip to content

[core] Add support for comma format #54

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

Open
wants to merge 2 commits into
base: nhairs-log-record
Choose a base branch
from

Conversation

nhairs
Copy link
Owner

@nhairs nhairs commented May 26, 2025

Fixes #15

Test Plan

  • Unit tests

To Do

Comment on lines +280 to +283
if self._fmt is None:
# TODO: does it matter that we do this before checking if the style is valid?
# (we already (mostly) check for valid style names in __init__
return []
Copy link
Owner Author

@nhairs nhairs May 26, 2025

Choose a reason for hiding this comment

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

Does it matter that we do this before checking if the style is valid?
We already (mostly) check for valid style names in __init__

Comment on lines +285 to +290
if isinstance(self._style, str) and self._style == ",":
# TODO: should we check that there are no empty fields?
# If yes we should do this in __init__ where we validate other styles?
# Do we drop empty fields?
# etc
return [field.strip() for field in self._fmt.split(",") if field.strip()]
Copy link
Owner Author

@nhairs nhairs May 26, 2025

Choose a reason for hiding this comment

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

Should we check that there are no empty fields?
If yes we should do this in __init__ where we validate other styles?
Is it okay that we drop empty fields?
etc

@@ -285,10 +303,7 @@ def parse(self) -> List[str]:
else:
raise ValueError(f"Style {self._style!r} is not supported")
Copy link
Owner Author

Choose a reason for hiding this comment

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

This needs updating. Probably need to find a different representation since $,%,{,, isn't exactly intuitive...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant