GDScript warning system

The GDScript warning system complements static typing (but it can work without static typing too). It's here to help you avoid mistakes that are hard to spot during development, and that may lead to runtime errors.

You can configure warnings in the Project Settings under the section called Gdscript:

Warning system project settings

Warning system project settings

You can find a list of warnings for the active GDScript file in the script editor's status bar. The example below has 3 warnings:

Warning system example

Warning system example

To ignore specific warnings in one file, insert a special comment of the form # warning-ignore:warning-id, or click on the ignore link to the right of the warning's description. Godot will add a comment above the corresponding line and the code won't trigger the corresponding warning anymore:

Warning system ignore example

Warning system ignore example

그리고 파일에서 단순히 한 경고가 아닌 특정 유형의 모든 경고를 선택할 수 있습니다. 주석은 # warning-ignore-all:경고-id입니다. 파일에서 모든 유형의 모든 경고를 무시하려면 # warnings-disable 주석을 추가하면 됩니다.

Warnings won't prevent the game from running, but you can turn them into errors if you'd like. This way your game won't compile unless you fix all warnings. Head to the GDScript section of the Project Settings to turn on this option. Here's the same file as the previous example with warnings as errors turned on:

Warnings as errors

Warnings as errors