Skip to content

Conversation

@Spontaniczny
Copy link
Contributor

This pull request sets up and applies automatic code formatting using pre-commit. It ensures that all future commits adhere to consistent code style rules for C.

@Spontaniczny
Copy link
Contributor Author

Where should I add documentation for pre-commit? To main READ.ME?
I used python to install pre-commit as it is the easies way to install it on every OS. Is this way OK?

@Spontaniczny Spontaniczny requested a review from grzanka June 20, 2025 05:01
@Spontaniczny Spontaniczny linked an issue Jun 20, 2025 that may be closed by this pull request
@grzanka
Copy link
Contributor

grzanka commented Jun 20, 2025

Where should I add documentation for pre-commit? To main READ.ME? I used python to install pre-commit as it is the easies way to install it on every OS. Is this way OK?

Add some markdown file in docs directory.

I need anyway to completely rework the README files, once that is done I will link it there.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates pre-commit tooling and a clang-format configuration to enforce consistent code style across the repository.

  • Adds .pre-commit-config.yaml with hooks for trimming whitespace, Python formatting (Black, isort), and C/C++ formatting (clang-format).
  • Introduces .clang-format based on Google style with a 120-column limit and custom pointer alignment.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
.pre-commit-config.yaml Configures pre-commit hooks for whitespace checks, Python and C/C++ formatting
.clang-format Establishes project’s C/C++ style rules, inheriting from Google style
Comments suppressed due to low confidence (3)

.pre-commit-config.yaml:1

  • Consider adding the 'check-yaml' hook from pre-commit-hooks to validate your YAML configuration files and catch syntax errors early.
repos:

.pre-commit-config.yaml:1

  • [nitpick] We should update the README to include instructions for developers to run pre-commit install after cloning, ensuring the hooks are activated locally.
repos:

.clang-format:1

  • [nitpick] It may help to add a comment or contributor guide explaining any deviations from the base Google style (e.g., pointer alignment), so new contributors understand these rules.
BasedOnStyle: Google

@Spontaniczny
Copy link
Contributor Author

Done

@grzanka grzanka merged commit 9b8b773 into master Jun 20, 2025
8 checks passed
@grzanka grzanka deleted the pre-commit-integration branch June 20, 2025 18:03
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.

Add .pre-commit with Google-style formatter

3 participants