Skip to content

Flooded by warnings from instrumented code #6

@ccx210

Description

@ccx210

The instrumented source code might introduce violations of some of the warnings/errors such as "unsafe_method_access" which cause the debugger to be flooded by warnings/errors. I know the default settings ignore the ones I'm turning on manually but it would be nice to have somewhere to shut them down while running gut hooks.
I'm not familiar enough with the codebase itself and how it's intended to work so there isn't a pull request but here is a stupid workaround that may or may not help, basically I manually added a @warning_ignore_start() at the top of the instrumented code. Not sure if this is the best place to do it but it at least seems working for me.

Hopefully there's a better solution.

...
	func _interpolate_coverage(coverage_script_path: String, script: GDScript, _id: int) -> String:
		var collector_var := "__cl__"
		var lines := script.source_code.split("\n")
		var indent_stack := []
		var ld_stack := []
		var write_var := false
		var state: int = Indent.State.NONE
		var next_state: int = Indent.State.NONE
		var subclass_name: String
		var next_subclass_name: String
		var depth := 0
+		var out_lines := PackedStringArray()
+		#@warning_ignore_start("unsafe_method_access", "untyped_declaration")...
+		var disable_warnings := "@warning_ignore_start(\"unsafe_method_access\", \"untyped_declaration\")"
+		out_lines.append(disable_warnings)
...

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