feat: add formatting options for file_history_panel#441
feat: add formatting options for file_history_panel#441protiumx wants to merge 6 commits intosindrets:mainfrom
Conversation
|
Thanks for the PR! Really nicely done with the tests :) I'll try to find time to review this properly sometime over this weekend. Something I can comment on immediately: please remove all unrelated code formatting changes from your PR. It only makes it harder to review the actual changes. Regarding your question about stylua: we don't use it. I should remove the config in the repo. I don't like how it formats code, and it's my opinion that it often hurts code readability. However, feel free to use it on the code that you write yourself. Regarding your remarks about monkey patching |
|
Hey @sindrets I removed the format changes. How do you format the lua files? I found the default lua lsp formatter to also produce different results. |
|
Hi @sindrets, any news for this PR? |
Description
Adding formatting option as a list of parts for the
file_history_panelcommit listThe default configuration includes all the parts that matches the commit format before this PR.
E.g.
Implementation
I defined a map of
formatters, one per each part which allows the user to use a list as config. This looks up in the map and runs the formatter on theRenderComponenttable.The only significant change in the format is the part for
author, datewhich now will show asauthor date.Should we add a different HL to make a distinction?
Stylua prolems
I have ran the following command and it has reformatted a lot of files, I'm not sure why
stylua 0.19.1
Docs
I updated the only the default config docs. I'll need assistance to add an entry in the main docs since I don't have experience writing vim docs
Testing
I covered almost all cases except for
date, in the branch that compares against the current time. This test would require to monkey patchos.timewhich I don't think would be a good practice.Closes #438