Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Enforce code style with clang-format #5342

Closed

Description

@brunoabinader

We've re-enabled clang-tidy checks as part of establishing good practices in our code changes. Keeping in line with that, we should start using clang-format - it automatically formats C++ code according to a set of configuration options - we actually maintain a .clang-format config already.

As @kkaefer suggested, we should have a bot that:

  1. Runs clang-format -i over mapbox-gl-native codebase;
  2. Runs git diff, then fails if there are any differences (showing diff output for reference).

👀 @mapbox/gl

Activity

  1. mikemorris commented on Jun 14, 2016

    @mikemorris
    Contributor

    Any way that we could script this into make test or npm test instead of relying on CI?

  2. brunoabinader commented on Jun 14, 2016

    @brunoabinader
    ContributorAuthor

    Any way that we could script this into make test or npm test instead of relying on CI?

    Yes, there will be a Makefile target for that - I suggest make check to separate it from unit test runs 👍 .

    Intent of adding it to CI is to prevent people from committing code that would eventually need to be sanitized later. Unlike clang-tidy, though, clang-format runs pretty fast (takes a couple seconds to perform) so I believe that won't be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions