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

Initial clang-format file trying to respect seraphis standards #3

Draft
wants to merge 6 commits into
base: seraphis_wallet
Choose a base branch
from

Conversation

DangerousFreedom1984
Copy link

@DangerousFreedom1984 DangerousFreedom1984 commented Jun 7, 2023

Would it be useful to have a .clang-format file that does all the formatting job when you press Ctrl-Shift-I in VSCodium/VSCode? If so, this is the closest I got so far to mimic the non-standard Seraphis style.

For this to work you just have to place the .clang-format file in the root directory of your repo and have the clang extension.

@rbrunner7
Copy link
Member

We have page about such Seraphis wallet coding conventions in our wiki here.

Can you please give a short list which conventions exactly this file enforces? The indentation by 4 blanks is obvious, as is all curly brackets on their own lines, but what else is there? E.g. is this meant to influence the formatting of comments somehow?

@rbrunner7
Copy link
Member

@DangerousFreedom1984 : Please see my question from 3 weeks ago.

And looking at this again, I asked myself whether this is something to really merge, and then having that file in the root (?) of the repository, or if the idea of this PR is just to make the file available to other parties that then pick it directly out of this PR.

@DangerousFreedom1984 DangerousFreedom1984 marked this pull request as draft October 2, 2023 06:43
@DangerousFreedom1984
Copy link
Author

Sorry, this is not to merge. It is just an attempt to make the code here standardized. Since everyone has his own style of coding, would be nice if we enforced a written set of rules to (1) reduce overhead while writing and (2) have uniformity.
I tried to follow Koe's style used in the seraphis_lib but there are many unwritten rules that is hard to enumerate all.

The most important to me are:

  • Brackets starting in a new line
  • Functions with one argument per line
  • Max 120 characters per line
  • Indentation of 4 spaces
  • Alignment of equations when possible (vscode fails to do that sometimes when equations are big so even this written set of rules may not be enough as one should get the 'spirit' of the style :p)

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.

3 participants