Skip to content

Reformatted all the files according to clang-format style#293

Merged
JF002 merged 2 commits intoInfiniTimeOrg:developfrom
Avamander:patch-5
Apr 26, 2021
Merged

Reformatted all the files according to clang-format style#293
JF002 merged 2 commits intoInfiniTimeOrg:developfrom
Avamander:patch-5

Conversation

@Avamander
Copy link
Copy Markdown
Collaborator

This PR autoformats every InfiniTime file according to the clang-format (also updated in this PR).

The PR will conflict with each and every other code PR!

Following the code style should be enforced in some way after the PR.

@JF002
Copy link
Copy Markdown
Collaborator

JF002 commented Apr 24, 2021

The alignment of public and private keyword in class declaration is a bit weird:

namespace Pinetime {
  namespace Applications {
    namespace Screens {

      class Motion : public Screen {
          public:
        Motion(DisplayApp* app, Controllers::MotionController& motionController);
        //...

Is this intentional? I'm more used to this:

namespace Pinetime {
  namespace Applications {
    namespace Screens {

      class Motion : public Screen {
      public:
        Motion(DisplayApp* app, Controllers::MotionController& motionController);
        //...

Or this:

namespace Pinetime {
  namespace Applications {
    namespace Screens {

      class Motion : public Screen {
        public:
        Motion(DisplayApp* app, Controllers::MotionController& motionController);
        //...

Also, template class declarations are on 1 line:

    template <class T> class SystemMonitor {
        public:
      SystemMonitor() = delete;
    };

when I'm used to declare them on 2 lines:

    template <class T> 
    class SystemMonitor {
        public:
      SystemMonitor() = delete;
    };

What is your opinion about theses 2 points?

@Avamander
Copy link
Copy Markdown
Collaborator Author

Avamander commented Apr 24, 2021

@JF002 I don't think there's a good way to achieve either currently. AccessModifierOffset can be changed into 0 which leaves it on the same level as the items after the access modifier, indentation after access modifier is not yet in (https://reviews.llvm.org/D60225).

If this is fine, I can apply it:

namespace Pinetime {
  namespace Applications {
    namespace Screens {

      class Motion : public Screen {
        public:
        Motion(DisplayApp* app, Controllers::MotionController& motionController);
        //...

-2 looks like this:

namespace Pinetime {
  namespace Applications {
    namespace Screens {

      class Motion : public Screen {
      public:
        Motion(DisplayApp* app, Controllers::MotionController& motionController);
        //...

@JF002
Copy link
Copy Markdown
Collaborator

JF002 commented Apr 24, 2021

-2 looks more natural to me.
In the current state, the access modifier (public/private) is more indented than the fields of the class, and that looks weird to me...

@Avamander
Copy link
Copy Markdown
Collaborator Author

@JF002 I've changed it to -2 and updated the files.

@JF002
Copy link
Copy Markdown
Collaborator

JF002 commented Apr 26, 2021

@Avamander Thanks !

@JF002 JF002 merged commit 4706c99 into InfiniTimeOrg:develop Apr 26, 2021
@Avamander Avamander deleted the patch-5 branch April 26, 2021 19:13
@JF002 JF002 added this to the Version 1.1 milestone May 16, 2021
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.

2 participants