Skip to content

Commit

Permalink
Merge pull request #8 from el-falso/el-falso-different-fixes
Browse files Browse the repository at this point in the history
- fix #4  
- fix #7
  • Loading branch information
el-falso authored Mar 21, 2024
2 parents 1789a14 + 14aafa3 commit 807cefc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion addons/gdLinter/UI/Dock.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ layout_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/Header"]
layout_mode = 2
bbcode_enabled = true
text = "[center]GDLint Plugin 2.0.0[/center]"
text = "[center]GDLint Plugin 2.0.1[/center]"
fit_content = true

[node name="LintedFile" type="PanelContainer" parent="VBoxContainer"]
Expand Down
20 changes: 12 additions & 8 deletions addons/gdLinter/gdLinter.gd
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@ func on_resource_saved(resource: Resource) -> void:
var regex := RegEx.new()
regex.compile("\\d+")
var result := regex.search(output_array[i])
var current_line := int(result.strings[0])-1
var error := output_array[i].rsplit(":", true, 1)
_dock_ui.create_item(current_line+1, error[1])
if _dock_ui.is_error_ignored(error[1]):
continue
highlight_lines.append(current_line)
if result:
var current_line := int(result.strings[0])-1
var error := output_array[i].rsplit(":", true, 1)
if len(error) > 1:
_dock_ui.create_item(current_line+1, error[1])
if _dock_ui.is_error_ignored(error[1]):
continue
highlight_lines.append(current_line)

_dock_ui.set_problems_label(_dock_ui.num_problems)
_dock_ui.set_ignored_problems_label(_dock_ui.num_ignored_problems)
Expand Down Expand Up @@ -168,9 +170,11 @@ func get_current_editor() -> CodeEdit:


func get_gdlint_path() -> String:
if OS.get_name() == "Windows":
return "gdlint"

# macOS & Linux
var output := []

OS.execute("python3", ["-m", "site", "--user-base"], output)
var python_bin_folder := (output[0] as String).strip_edges().path_join("bin")

return python_bin_folder.path_join("gdlint")
2 changes: 1 addition & 1 deletion addons/gdLinter/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="gdLinter"
description="Runs `gdlint` on save to automatically lint your GDScript as you code."
author="Falli"
version="2.0.0"
version="2.0.1"
script="gdLinter.gd"

0 comments on commit 807cefc

Please sign in to comment.