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

Preservation of time units when formatting LF code #1518

Merged
merged 1 commit into from
Dec 22, 2022
Merged

Conversation

cmnrd
Copy link
Collaborator

@cmnrd cmnrd commented Dec 22, 2022

Currently, the formatter changes time units to the "canonical" name as defined in TimeUnit. For instance, it would change 2 s to 2 sec. I think we should leave the decision of which time units to choose to the user. Personally (maybe because I am European), I prefer SI units. Which unit works the best might also depend on the target language. For instance, the C++ chrono library allows writing 2s, but not 2sec. So it would be idiomatic to use the SI units in LF-C++ programs.

Copy link
Collaborator

@petervdonovan petervdonovan left a comment

Choose a reason for hiding this comment

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

LGTM!

@cmnrd cmnrd merged commit a1a916b into master Dec 22, 2022
@cmnrd cmnrd deleted the formatter-time branch December 22, 2022 11:56
@lhstrh lhstrh changed the title Preserve time units when formatting LF code Preservation of time units when formatting LF code Jan 26, 2023
@lhstrh lhstrh added the enhancement Enhancement of existing feature label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants