gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Improve frontend formatting

Open CohenArthur opened this issue 3 years ago • 5 comments

  • [ ] Make sure of newline between two function definitions
  • [ ] When creating a scope in a switch case, brackets go under the colon and are indented
case foo: {
    auto bar = baz();
}

becomes

case foo:
  {
    auto bar = baz();
  }
  • [ ] Make sure to respect the GNU coding style convention overall
  • [ ] Remove braces when creating one-line if blocks

CohenArthur avatar Nov 15 '22 11:11 CohenArthur

do we have to update the syntax you have provided for every single file? and will the new syntax will stay the same if some do cargo fmt? please assign me for this task

ArshErgon avatar Dec 13 '22 12:12 ArshErgon

Cargo fmt won't have any effect as gccrs is written in C++ and rustfmt only formats rust code.

bjorn3 avatar Dec 13 '22 13:12 bjorn3

do we have to update the syntax you have provided for every single file? and will the new syntax will stay the same if some do cargo fmt? please assign me for this task

Yes, and as @bjorn3 mentionned this is a C++ project so we're using clang-format. The syntax should stay the same when running clang-format as it's still valid GNU C++ style. Are you still interested in working on the issue @ArshErgon ?

CohenArthur avatar Dec 13 '22 15:12 CohenArthur

Hey @CohenArthur it will take some time, but I will do it.

ArshErgon avatar Dec 14 '22 03:12 ArshErgon

Sounds good @ArshErgon :) Thanks. Assigning you!

CohenArthur avatar Dec 14 '22 09:12 CohenArthur