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

Bringing the tree up to formatting parity with clang-format, shellcheck, shfmt, yaml linting, and MD lint #432

Merged
merged 13 commits into from
Apr 21, 2020

Conversation

woody-apple
Copy link
Contributor

@woody-apple woody-apple commented Apr 20, 2020

Problem

make-pretty doesn't check much of the source tree, let's not push the burden of people fixing restyled ad hoc, pull the bandaid!

Summary of Changes

Restyle all the things from a command line too. Changes to come separately for that.

#include "LEDWidget.h"
#include "AppTask.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder what rule this is for

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably adding your own header include at the top. Seems reasonable to me. It's in the clang format :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might only be applying this to C++, looking...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, no clue. I'm not a clang-format expert. I checked the sorting options available, and not clear to me the logic it's applying. It's stable now, so unless you know which option you'd like me to check, I'd love for that to be a different PR (happy to re-format then too)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratching that, not a clang-format expert. Happy to change the format as needed. I'm just mechanically applying the existing format to everything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one looks correct to me, just baffled that it applied another rule to init_lcd

@@ -177,7 +176,7 @@ inline void BLEManagerImpl::SetAdvertisingHandle(uint8_t handle)

inline BleLayer * BLEManagerImpl::_GetBleLayer() const
{
return (BleLayer *)(this);
return (BleLayer *) (this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird one

@@ -606,7 +707,10 @@ inline void Put16(uint8_t *p, uint16_t v) { nl::IO::BigEndian::PutUnaligne
* swapped.
*
*/
inline void Put32(uint8_t *p, uint32_t v) { nl::IO::BigEndian::PutUnaligned32(p, v); }
inline void Put32(uint8_t * p, uint32_t v)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes make me worry that restyled might be using a different configuration than we'd already settled on (clang-format-9 with the current ToT/.clang-format).

the reason it makes me worry is because I believe these files were reformatted in a PR of mine to that configuration...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind. I think this must have been a file outside of "make pretty" at the time. My editor is happy with this formatting.

Copy link
Contributor

@turon turon Apr 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree -- the existing make pretty-check that is run on every PR now should be enforcing compliance on all files under src, so any style changes on those files should be viewed with suspicion.

Perhaps this shows that headers are escaping the current checks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm it only uses the clang format supplied. Ran same command by command line. This file was outside make pretty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, make-pretty doesn't hit all files. Coming up with a solution later that replaces it with something that will do it without developer configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Copy link
Contributor

@rwalker-apple rwalker-apple Apr 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree -- the existing make pretty-check that is run on every PR now should be enforcing compliance on all files under src, so any style changes on those files should be viewed with suspicion.

Perhaps this shows that headers are escaping the current checks?

@turon we're not doing make pretty-check on PRs anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: You're welcome to, but it's an un-needed task now, and doesn't have the same breadth as restyled. I'm working a local restyled for those that want to run it before the PR.

Copy link
Contributor

@BroderickCarlin BroderickCarlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@woody-apple woody-apple merged commit 0a9545e into project-chip:master Apr 21, 2020
@woody-apple woody-apple deleted the restyle-baseline branch May 8, 2020 02:05
mkardous-silabs pushed a commit to mkardous-silabs/connectedhomeip that referenced this pull request Dec 19, 2022
…D4166A

Merge in WMN_TOOLS/matter from thermostat_fix to silabs_slc_1.0

Squashed commit of the following:

commit 267b7c99fd9565346fa35c35d99d5b0da06b8454
Author: Hussein Elsherbini <[email protected]>
Date:   Tue Dec 13 22:34:16 2022 -0500

    adds an exclusion of thermostatUI.h thermostatIcons.h and thermostatUI.cpp if brd4166a is target
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.

6 participants