Skip to content

Insert license and top-of-file whitespace #107

Open

Description

@Wheest

Unsure if this is intended behavior, but I had a C file with 2 lines of whitespace a the top:

[whitespace]
[whitespace]
/* Some comment */

int main() {
  return 0;
}

The insert-license hook inserts the license after this whitespace:

[whitespace]
[whitespace]
// Licenced under FooBar

/* Some comment  */

int main() {
  return 0;
}

I would have expected it to be inserted after.

Activity

  1. Wheest commented on Apr 10, 2026

    @Wheest
    Author

    A few examples that I've seen that have this sort of problem: https://github.com/Wheest/precommit_copyright_hook_bug/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions