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

add pre-commit hook for clang-format #4599

Merged
merged 2 commits into from
Jul 1, 2023

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented Jun 29, 2023

High Level Overview of Change

This PR adds a pre-commit hook, which runs the clang-format linter locally before a commit is committed.

There are no C++ code changes, just a new YAML file and instructions in the CONTRIBUTING for how to set up the linter.

Context of Change

A pre-commit hook makes it easier to work with the clang-format linter, since it automatically runs before a commit is committed. It is also opt-in (you need to install it for it to do anything).

Type of Change

  • Tooling

Test Plan

This was tested locally and worked when I tried to commit a change that didn't satisfy the linter.

I also confirmed that it is indeed using the correct version of clang-format (10.0.1).

@mvadari mvadari force-pushed the clang-pre-commit branch from 86243dd to 353d2ae Compare June 29, 2023 18:16
@mvadari mvadari changed the title add pre-commit yaml for clang-format add pre-commit hook for clang-format Jun 29, 2023
CONTRIBUTING.md Outdated Show resolved Hide resolved
@mvadari mvadari force-pushed the clang-pre-commit branch from 353d2ae to 586ee9c Compare June 29, 2023 18:45
@mvadari mvadari requested a review from thejohnfreeman June 29, 2023 18:48
@intelliot intelliot requested a review from ximinez June 29, 2023 22:43
@intelliot intelliot merged commit 9c50415 into XRPLF:develop Jul 1, 2023
ckeshava pushed a commit to ckeshava/rippled that referenced this pull request Jul 10, 2023
* Add a new YAML file (.pre-commit-config.yaml) to set up pre-commit
  hook for clang-format
  * The pre-commit hook is opt-in and needs to be installed in order to
    run automatically
* Update CONTRIBUTING.md with instructions on how to set up and use the
  clang-format linter

Automating the process of running clang-format before committing code
helps to save time by removing the need to fix formatting issues later.

This is a tooling improvement and doesn't change C++ code.
ckeshava pushed a commit to ckeshava/rippled that referenced this pull request Sep 22, 2023
* Add a new YAML file (.pre-commit-config.yaml) to set up pre-commit
  hook for clang-format
  * The pre-commit hook is opt-in and needs to be installed in order to
    run automatically
* Update CONTRIBUTING.md with instructions on how to set up and use the
  clang-format linter

Automating the process of running clang-format before committing code
helps to save time by removing the need to fix formatting issues later.

This is a tooling improvement and doesn't change C++ code.
ckeshava pushed a commit to ckeshava/rippled that referenced this pull request Sep 25, 2023
* Add a new YAML file (.pre-commit-config.yaml) to set up pre-commit
  hook for clang-format
  * The pre-commit hook is opt-in and needs to be installed in order to
    run automatically
* Update CONTRIBUTING.md with instructions on how to set up and use the
  clang-format linter

Automating the process of running clang-format before committing code
helps to save time by removing the need to fix formatting issues later.

This is a tooling improvement and doesn't change C++ code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants