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

header_guards.py fails if file is too short #98813

Closed
KoBeWi opened this issue Nov 4, 2024 · 0 comments · Fixed by #100167
Closed

header_guards.py fails if file is too short #98813

KoBeWi opened this issue Nov 4, 2024 · 0 comments · Fixed by #100167

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Nov 4, 2024

Tested versions

4.4 1bffd6c

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

I created a new file, applied copyright_headers.py and tried header_guards.py, but it failed with

IndexError: list index out of range
Traceback (most recent call last):
  File "C:\godot_source\misc\scripts\header_guards.py", line 74, in <module>
    lines[HEADER_CHECK_OFFSET] == HEADER_CHECK

The script expects guards at specific line, but if file is too short, it goes out of bounds.

Steps to reproduce

  1. Create new .h file in Godot source directory
  2. Run python misc/scripts/header_guards.py path/to/that/file.h

Minimal reproduction project (MRP)

https://github.com/godotengine/godot/archive/refs/heads/master.zip

@github-project-automation github-project-automation bot moved this to For team assessment in Buildsystem Issue Triage Nov 4, 2024
@akien-mga akien-mga moved this from For team assessment to Up for grabs in Buildsystem Issue Triage Nov 4, 2024
@AThousandShips AThousandShips moved this from Up for grabs to Fix pending review in Buildsystem Issue Triage Dec 8, 2024
@github-project-automation github-project-automation bot moved this from Fix pending review to Done in Buildsystem Issue Triage Dec 9, 2024
@Repiteo Repiteo added this to the 4.4 milestone Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants