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

build: introduce pre-commit #18

Merged
merged 4 commits into from
Feb 25, 2025
Merged

build: introduce pre-commit #18

merged 4 commits into from
Feb 25, 2025

Conversation

fvranicTT
Copy link
Contributor

@fvranicTT fvranicTT commented Feb 24, 2025

Description:
This PR introduces consistent formatting for all C++ and Python files to ensure uniform code style across the repository. While this is not a final set of formatting rules, it serves as an initial baseline that can be refined over time.

Since this change affects most files, merging it will help keep future PRs clean and focused on functional changes rather than formatting inconsistencies. After merging, I will follow up with another PR to remove this change from git history, preventing unnecessary git blame noise.

Next Steps:

  • Specific formatting rules can be adjusted as needed.
  • A follow-up PR will clean up the commit history to maintain meaningful git blame tracking.

Let me know if you have any concerns or suggestions!

@fvranicTT fvranicTT force-pushed the filip/introduce-precommit branch 5 times, most recently from 0d1efff to c607f9c Compare February 24, 2025 14:46
@ncvetkovicTT
Copy link
Contributor

@fvranicTT Do we maybe want to block binaries from being committed as well? Are they blocked by default somehow? If so, is the filter configurable, for instance if we want to add documentation in the future and some .png sneaks in as a screenshot instead of a .svg.

Copy link
Contributor

@ncvetkovicTT ncvetkovicTT left a comment

Choose a reason for hiding this comment

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

Thanks

@fvranicTT
Copy link
Contributor Author

@fvranicTT Do we maybe want to block binaries from being committed as well? Are they blocked by default somehow? If so, is the filter configurable, for instance if we want to add documentation in the future and some .png sneaks in as a screenshot instead of a .svg.

A very good question. I tried blocking binaries with check-added-large-files, which by default blocks everything above 500 KB. We can set this limit higher, and PNG images are good example why we might want to have these files. pre-commit can't block particular extensions, e.g. so we could forbid commiting .so files by mistake.

@fvranicTT fvranicTT force-pushed the filip/introduce-precommit branch from 45740b2 to 93f8971 Compare February 25, 2025 21:13
@fvranicTT fvranicTT marked this pull request as ready for review February 25, 2025 21:14
@fvranicTT fvranicTT merged commit 7e81cb9 into main Feb 25, 2025
@fvranicTT fvranicTT deleted the filip/introduce-precommit branch February 25, 2025 21:23
fvranicTT added a commit that referenced this pull request Feb 26, 2025
fvranicTT added a commit that referenced this pull request Feb 26, 2025
This reverts commit 7e81cb9.

Reverting because commit triggered a lot of build errors in tt-metal,
due to missing includes. At the moment, I'm not sure how it worked so
far.
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.

3 participants