8000 GitHub - TiesDO/gdlint · GitHub
[go: up one dir, main page]

Skip to content
TiesDOPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

82 Commits

Folders and files

Repository files navigation

gdlint

A simple linter for gdscript

Goal

Support a variety of linting rules based on the gdscript style guide in a configurable manor.

Usage

There are 2 main entrypoints, a simple cli call and an LSP over stdin/stdout. To use the CLI you can build the application using just.

just build

The application will be built to ./bin/gdlint and can then be used as follows:

./bin/gdlint check ./fixtures/scripts/class_declarations.gd

The check command also support --include and --exclude flags, run ./bin/gdlint check to see the help.

If you want to have your editor (for example Zed) use gdlint you can add the following override in ./.zed/settings.json.

{
  "lsp": {
    "gdscript": {
      "binary": {
        "path": "./bin/gdlint",
        "arguments": ["lsp"]
      }
    }
  },
  "languages": {
    "GDScript": {
      "language_servers": [
        "gdscript"
      ]
    }
  }
}

When you open a gdscript file (like ./fixtures/scripts/typed_assignments.gd) you should see warnings pop up in the file.

Architecture

TODO

Roadmap

Rules

  • detect missing type declarations\
    • variables / constants
    • function arguments
    • function return types
    • signals
  • detect name casing
    • functions
    • variables / constants
    • classes
    • signals
    • files
    • enums + members
  • ordering (top level)
  • whitespace
    • variable assignments
    • conditions
    • math operations
  • formatting
    • line length
    • blank lines
    • array, enum, dict elements alignment
    • quote style
    • numbers
      • underscore usage
      • float decimal
      • hex caps
    • single line ternary
  • pattern detection
    • simplified loops with higher level method
    • unused locals/privates
    • unreachable code

Fixes

  • ordering
  • whitespace
  • formatting
  • pattern detection

Capabilities

  • built in rule detection
  • cli check command
  • cli fix command
  • lsp didOpen/didChange
  • lsp publishDiagnostics
  • lsp didSave
  • lsp code actions (workspace/applyEdits)
  • lsp textDocument/formatting
  • lsp workspace/diagnostics
  • lsp workspace/didChangeWatchedFiles
  • configuration file
    • ignored rules
    • excluded/included files
    • severity level per rule
    • overridable settings
      • line length
      • default string quote
  • inline disable/enable comments

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0