Enforce code style on doc comments #156#158
Conversation
|
@koraa can you tell me if this approach is correct |
wesleymatosdev
left a comment
There was a problem hiding this comment.
IMO it also needs to be checked if the project will actually use prettier or if it'll use other tooling to handle it.
I know you took inspiration from tailcallhq/tailcall, but every project has different needs and we could have checked with @koraa if this is the desired approach before working on the implementation.
|
/tip 10 |
|
🎉🎈 @alankritdabral has been awarded $10! 🎈🎊 |
Thank you for the tip. Should i close the pr as @Min2who wants to get it assigned or should i keep working on it |
You are invited to keep working on this or collaborate with @ologbonowiwi or @Min2who or both and if the bounty is low or all three of you want to share in the bounty, I can raise it a bit too (in this case you would have to post a bid in this issue); I am sure either could help you figure out how to tackle this issue. I'd rather enable people to work on issues than get bogged down by assigning ownership :) The basic two steps to (1) format examples in the readme and (2) format examples in doc comments can be tackled in parallel anyway! |
|
@alankritdabral Do you intend to finish this project? |
|
|
@koraa can you take a look in the code changes you can even run locally |
|
The approach doesn't yet work (but it can be fixed!).
|
|
@wucke13 what to do with non-utf8 codes rustfmt cant deal with it should i just ignore non-utf8 ?? |
wesleymatosdev
left a comment
There was a problem hiding this comment.
I don't think the optimal solution is to format the files on CI, as we would need to commit the files
Maybe we can have the script to format the files (as/when users wish), and on CI we fail a pipeline if formatting is not correct
yes i am going to use rustfmt--check in the ci by default |
|
To be clear, the CI shall only check/verify, but it shall not change code on its own. |
|
@wucke13 can you run the workflow and review it |
|
@wucke13 🤓 |
|
Hi @alankritdabral, this is pretty hacky…but also pretty cool. It only solves half of the issue – i.e. formatting examples in markdown code while disregarding markdown code in rustdoc but be that as it may, I am happy to merge this and award the bounty for just that improvement. If I run
Can you elaborate on what you mean by non-utf8? All our source files should be utf8-encoded. |
i have fixed this issue will be pushing in a new pr |
well it was a mistake from my side thee code was treating anything inside fence code with |
|
@koraa i have tested the file now its working fine |
This script makes it possible to check formatting of rust code found in the various markdown files in the repo. It is also added as a job to the QC CI workflow.
This applies the novel format_rustcode.sh script to the markdown files in the repo, to maintain a consistent style across code examples.
af90515 to
ea32bbd
Compare
|
@alankritdabral I took the liberty to squash your commits and apply the tool as well. Thank you for your contribution! |
just wanted to know if there is any community for the rosenpass for eg ddiscord? |
Yes there is, you would be most welcome to join our matrix developer chat :) |
Summary:
Added format_rust_code.sh file that uses rustfmt tool on rust code in fences.
to check document formatting run: run bash format_rust_code.sh --mode check
to fix run : run bash format_rust_code.sh --mode fix
modifie qc.yml: To run format_rust_code.sh
Issue References:
Fixes: #156
/claim #156