Skip to content

[all] Cleanup unformatted files #7267

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN

/// Queue-specific context data to be associated with the capture session queue.
extern const char* FLTCaptureSessionQueueSpecific;
extern const char *FLTCaptureSessionQueueSpecific;
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably depends on the exact version of clang-format, due to changes in the logic for detecting whether a file is C++ or Obj-C.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'm using the latest clang-format version. What version is CI using? Or has this file just not been touched in a really long time?


/// Ensures the given block to be run on the main queue.
/// If caller site is already on the main queue, the block will be run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CaptureControllerImpl::CaptureControllerImpl(
: capture_controller_listener_(listener),
media_settings_(
PlatformMediaSettings(PlatformResolutionPreset::kMax, true)),
CaptureController(){};
CaptureController() {};
Copy link
Contributor

Choose a reason for hiding this comment

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

All of the rest of these are minor differences in how clang-format handles this code, but the easy solution to these is to fix them all to not have the stray ; that shouldn't be there and is causing it to have non-trivial format analysis. Every one of these should have stable formatting across versions once the incorrect ; is gone.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the ; and the formatter still adds the space. Is that the expected behavior?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the space is correct.


CaptureControllerImpl::~CaptureControllerImpl() {
ResetCaptureController();
Expand Down
15 changes: 8 additions & 7 deletions packages/camera/camera_windows/windows/test/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class MockCameraFactory : public CameraFactory {
class MockCamera : public Camera {
public:
MockCamera(const std::string& device_id)
: device_id_(device_id), Camera(device_id){};
: device_id_(device_id), Camera(device_id) {};

~MockCamera() = default;

Expand Down Expand Up @@ -217,7 +217,7 @@ class MockCamera : public Camera {

class MockCaptureControllerFactory : public CaptureControllerFactory {
public:
MockCaptureControllerFactory(){};
MockCaptureControllerFactory() {};
virtual ~MockCaptureControllerFactory() = default;

// Disallow copy and move.
Expand Down Expand Up @@ -263,14 +263,15 @@ class MockCameraPlugin : public CameraPlugin {
public:
MockCameraPlugin(flutter::TextureRegistrar* texture_registrar,
flutter::BinaryMessenger* messenger)
: CameraPlugin(texture_registrar, messenger){};
: CameraPlugin(texture_registrar, messenger) {};

// Creates a plugin instance with the given CameraFactory instance.
// Exists for unit testing with mock implementations.
MockCameraPlugin(flutter::TextureRegistrar* texture_registrar,
flutter::BinaryMessenger* messenger,
std::unique_ptr<CameraFactory> camera_factory)
: CameraPlugin(texture_registrar, messenger, std::move(camera_factory)){};
: CameraPlugin(texture_registrar, messenger, std::move(camera_factory)) {
};

~MockCameraPlugin() = default;

Expand All @@ -290,7 +291,7 @@ class MockCameraPlugin : public CameraPlugin {

class MockCaptureSource : public IMFCaptureSource {
public:
MockCaptureSource(){};
MockCaptureSource() {};
~MockCaptureSource() = default;

// IUnknown
Expand Down Expand Up @@ -357,7 +358,7 @@ class MockCaptureSource : public IMFCaptureSource {
// Uses IMFMediaSourceEx which has SetD3DManager method.
class MockMediaSource : public IMFMediaSourceEx {
public:
MockMediaSource(){};
MockMediaSource() {};
~MockMediaSource() = default;

// IUnknown
Expand Down Expand Up @@ -853,7 +854,7 @@ class FakeMediaType : public FakeIMFAttributesBase<IMFMediaType> {
: major_type_(major_type),
sub_type_(sub_type),
width_(width),
height_(height){};
height_(height) {};

// IMFAttributes
HRESULT GetUINT64(REFGUID key, UINT64* value) override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace local_auth_windows {
class UserConsentVerifierImpl : public UserConsentVerifier {
public:
explicit UserConsentVerifierImpl(std::function<HWND()> window_provider)
: get_root_window_(std::move(window_provider)){};
: get_root_window_(std::move(window_provider)) {};
virtual ~UserConsentVerifierImpl() = default;

// Calls the native Windows API to get the user's consent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using ::testing::_;

class MockUserConsentVerifier : public UserConsentVerifier {
public:
explicit MockUserConsentVerifier(){};
explicit MockUserConsentVerifier() {};
virtual ~MockUserConsentVerifier() = default;

MOCK_METHOD(winrt::Windows::Foundation::IAsyncOperation<
Expand Down