Skip to content

Add staged_cpplint script that checks only staged files #194

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

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

karolzwolak
Copy link
Contributor

The script is supposed to be run from pre-commit hook. The hook makes it impossible to commit cpp source file or header that does not pass cpplint checks, and saves you from long checking times of other scripts that check all files.

To create the hook, create executable file
.git/hooks/pre-commit:

#!/bin/bash
tools/cpplint/staged_cpplint.sh

The script is supposed to be run from pre-commit hook
@karolzwolak karolzwolak requested a review from a team as a code owner February 24, 2025 19:39
@Mateusz-Krajewski
Copy link
Collaborator

@karolzwolak Jest jakaś różnica czasowa względem tools/cpplint/cpplint.sh ?

@karolzwolak
Copy link
Contributor Author

Tak i to spora, chociaż ja to bazowałem na user_cpplint.sh
image

Copy link
Collaborator

@Mateusz-Krajewski Mateusz-Krajewski left a comment

Choose a reason for hiding this comment

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

wyniki nie pokrywaja sie ze skryptami cpplint, choć czas wykonywania jest znacznie lepszy
image

@karolzwolak
Copy link
Contributor Author

A masz zastageowane te zmiany? Ten skrypt jest szybszy, bo sprawdza tylko te pliki, które chcesz zcommitować.

@Mateusz-Krajewski
Copy link
Collaborator

A masz zastageowane te zmiany? Ten skrypt jest szybszy, bo sprawdza tylko te pliki, które chcesz zcommitować.

dobra mój błąd, w takim razie zostaje jako osobny skypt

Copy link
Collaborator

@Mateusz-Krajewski Mateusz-Krajewski left a comment

Choose a reason for hiding this comment

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

ok

@Mateusz-Krajewski Mateusz-Krajewski added this pull request to the merge queue Feb 24, 2025
Merged via the queue into master with commit 92362b1 Feb 24, 2025
8 checks passed
@Mateusz-Krajewski Mateusz-Krajewski deleted the cpplint-hook branch February 24, 2025 20:23
Mateusz-Krajewski pushed a commit that referenced this pull request Mar 1, 2025
The script is supposed to be run from pre-commit hook
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.

2 participants