Skip to content

Errors in current state of pre-commit script #1534

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

Open
spenke91 opened this issue Apr 2, 2025 · 0 comments
Open

Errors in current state of pre-commit script #1534

spenke91 opened this issue Apr 2, 2025 · 0 comments
Assignees
Labels
Bug For a bug in the Code priority:high Should be solved as soon as possible Wiki workload:low Would take half a day or less

Comments

@spenke91
Copy link
Collaborator

spenke91 commented Apr 2, 2025

Bug report

Describe the bug
While working in t8code, I today realized two things regarding the pre-commit script:

  1. Since I copied the pre-commit script into .git/hooks as described in the Coding Guidelines, the names of the scripts for checking macros and indentation had changed. As a result, my pre-commit hook did not find them and thus always reported every file as not indented.
    My suggestion to fix this would be to change the coding guidelines, such that it suggests linking the script from scripts/pre-commit into.git/hooks/ rather than copying it. This way, any changes in the pre-commit script would automatically be applied within the hook. (This does require a minor update of how to handle the paths, as you will see in the associated PR.)

  2. After figuring out the issue described in 1., I switched to the latest state of the pre-commit script and found some errors there. My guess is that some local changes have accidentially been pushed to origin, because of:

    # This is the indent script in the project's directory
    echo "test"
    GIT_DIR= git rev-parse --git-dir
    echo "$GIT_DIR"
    echo "test2"
    CHECK_INDENT=$GIT_COMMON_DIR/scripts/check_if_file_indented.sh
    
    CHECK_MACROS=$GIT_COMMON_DIR/scripts/check_macros.sh
    

    My suggestion to fix this will be outlined in a PR I will open next, that is, Bugfix: Fix wrong paths in pre-commit script #1535.

To Reproduce
Feel free to try the current version of pre-commit for yourself

Expected behavior

Log files

Environment (please complete the following information):

  • Teamserver

Estimated priority

"Priority: high" Should be solved as soon as possible

Additional context

@spenke91 spenke91 self-assigned this Apr 2, 2025
@spenke91 spenke91 added Bug For a bug in the Code Wiki priority:high Should be solved as soon as possible workload:low Would take half a day or less labels Apr 2, 2025
@t8ddy t8ddy moved this from In-Box to ToDo in t8code's Issue Landing page Apr 2, 2025
@Davknapp Davknapp moved this from ToDo to In Progress in t8code's Issue Landing page Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For a bug in the Code priority:high Should be solved as soon as possible Wiki workload:low Would take half a day or less
Projects
Status: In Progress
Development

No branches or pull requests

1 participant