A fast and flexible analyzer for GML. 🦆

Overview

duck

tests GitHub experimental gm_version

⚠️ duck is not yet released and is unstable! An announcement will be made when 0.1.0 is released.

A fast and flexible analyzer for GML (GameMaker Language).

example of the missing_case_member lint in action

duck is is a highly flexible analyzer that enables far stricter rules for GML than GameMaker itself enforces. It is able to detect code that will directly lead to errors as well as enforce styling rules -- all of which are completely customizable.

duck is also extremely fast. It currently can fully process a 250,000 line project in less than half a second.

Table of Contents

Type Checking

duck's most powerful feature is its ability to type-check GML without compromising on the language's flexibility. This feature is currently in development and is not enabled on releases. Developers can enable type analysis by enabling the solve feature. More information coming soon!

Lints

duck comes with a variety of lints that offer nuanced feedback about your code, ranging from offering stylistic feedback to encouraging better code patterns.

duck currently supports 36 lints. You can use duck explain <LINT_NAME> to learn more about each lint as you encounter them.

Customization

duck can use a configuration file per-project to change how it behaves. The most basic adjustment you can make is overriding the default "level" of any lint.

[lint-levels]
and_preference = "allow"
try_catch = "warn"
missing_case_member = "deny"

This demonstrates the three different levels: "allow" will tell duck to fully ignore the lint, "warn" will mark them as warnings, and "deny" will treat them like full errors.

Some lints come with customizable behavior. english_flavor_violation, for example, let's you decide between the British or American spelling of GML functions. var_prefix_violation let's you decide if you prefer local variables to be prefixed with an underscore (_foo) or with nothing at all (foo).

You can read more about these customization features and how to set them up here.

Tags

duck supports parsing for arbitrary tags in the codebase written with the following syntax:

// #[tag]
// #[tag_with_parameter(parameter)]

Developers can use duck as a library to fetch all expressions / statements that are tagged in the source code, opening the doors to many new tools that don't need to worry about parsing GML themselves.

These allow for developers to create their own tools for gml while using duck to handle their parsing.

Additionally, duck supports allow, warn and deny tags to customize linting rules on a case by case basis. For example, while I may want globalvar to be banned from my codebase, I might have one or two excpetions You can tag the specific occurance of the usage to acknowledge (and ignore) the lint.

// #[allow(deprecated)]
globalvar my_globalvar;

Tags are a great way to enable lints on things you don't want to fully ban, but want to keep a close eye on.

Instalation

The latest release can be found here. Rust users can also install with cargo: cargo install duck.

Usage

To run duck, simply use the run command!

duck run

There are a few different options you can use, as well as other commands. Enter duck help for more information.

Support and Requests

Please open an issue if you encounter any problems with duck, or if you have any feature requests you would like to make!

Footnotes

  • Benchmark was run on an MacBook Pro 2021 running an M1 Max with 32 GB of memory.
You might also like...
A opinionated and fast static analyzer for PHP.
A opinionated and fast static analyzer for PHP.

TLDR; A static analyzer for PHP. It helps you catch common mistakes in your PHP code. These are the current checks implemented. Extending undefined cl

Highly parallelized, blazing fast directory tree analyzer
Highly parallelized, blazing fast directory tree analyzer

Parallel Disk Usage (pdu) Highly parallelized, blazing fast directory tree analyzer. Description pdu is a CLI program that renders a graphical chart f

A fast static code analyzer & language server for Python
A fast static code analyzer & language server for Python

pylyzer ⚡ pylyzer is a static code analyzer / language server for Python written in Rust. Installation cargo (rust package manager) cargo install pyly

A fast, powerful, flexible and easy to use open source data analysis and manipulation tool written in Rust

fisher-rs fisher-rs is a Rust library that brings powerful data manipulation and analysis capabilities to Rust developers, inspired by the popular pan

A fast, powerful, flexible and easy to use open source data analysis and manipulation tool written in Rust

fisher-rs fisher-rs is a Rust library that brings powerful data manipulation and analysis capabilities to Rust developers, inspired by the popular pan

Hashlink bytecode disassembler, analyzer, decompiler and assembler.
Hashlink bytecode disassembler, analyzer, decompiler and assembler.

Hashlink bytecode This repository contains a collection of Rust crates and cli tools to load, disassemble, decompile and analyze Hashlink bytecode. Re

A Solidity static analyzer to identify contract vulnerabilities and gas efficiencies.

solstat A Solidity static analyzer to identify contract vulnerabilities and gas efficiencies. .------. .------. .------. .------. .------. .------. .-

Regorus - Rego interpreter, analyzer and validator written in Rust

regorus THIS REPOSITORY IS IN ACTIVE DEVELOPMENT AND NOT INTENDED FOR PRODUCTION USE. Regorus is a Rego interpreter, analyzer and checker written in R

A device-tree source parser, analyzer and language server.

Ginko A device-tree source parser, analyzer and language server. The main goal of this project is to make working with device-trees easy. For example,

A backend framework for building fast and flexible APIs rapidly.

Andromeda Andromeda is a backend framework for Rust, to simplify the development of the kinds of basic API services that we developers have to build s

A fast and flexible LRU map.

A fast and flexible LRU map This repository contains a fast and flexible LRU map. Blazingly fast. Up to twice as fast as the lru crate, and with less

dua (- Disk Usage Analyzer) is a tool to conveniently learn about the usage of disk space of a given directory

dua (- Disk Usage Analyzer) is a tool to conveniently learn about the usage of disk space of a given directory. It's parallel by default and will max

rust-analyzer is a modular compiler frontend for the Rust language
rust-analyzer is a modular compiler frontend for the Rust language

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

A Japanese Morphological Analyzer written in pure Rust

Yoin - A Japanese Morphological Analyzer yoin is a Japanese morphological analyze engine written in pure Rust. mecab-ipadic is embedded in yoin. :) $

SQL / SQLI tokenizer parser analyzer

libinjection SQL / SQLI tokenizer parser analyzer. For C and C++ PHP Python Lua Java (external port) [LuaJIT/FFI]

Shisho is a lightweight static analyzer for developers.
Shisho is a lightweight static analyzer for developers.

Lightweight static analyzer for several programming languages

ik-analyzer for rust; chinese tokenizer for tantivy

ik-rs ik-analyzer for Rust support Tantivy Usage Chinese Segment let mut ik = IKSegmenter::new(); let text = "中华人民共和国"; let tokens = ik.to

irulescan is a static security analyzer for iRules

irulescan is a tool to scan iRules for unexpected/unsafe expressions that may have undesirable effects like double substitution.

μLA: Micro Logic Analyzer for RP2040
μLA: Micro Logic Analyzer for RP2040

μLA: Micro Logic Analyzer SUMP/OLS compatible logic analyzer firmware for RP2040 based boards. Features 16 channels 100 MHz sampling rate, 1 sample pe

Comments
  • Implements `duck emit` to serialize Asts to a file

    Implements `duck emit` to serialize Asts to a file

    Implements a new command (duck emit) to serialize the Asts from a project or single file.

    image

    Given the following gml in example.gml:

    self.foo = {
        bar: 0
    };
    
    return self.foo.bar != 5;
    

    duck emit output.yaml -p example.gml -f yaml yields the following:

    ----
    /Users/gabe/Documents/example.gml:
      stmts:
        - stmt_kind: assignment
          left:
            expr_kind: access
            type: identity
            lexeme: foo
          op:
            type: identity
            token: "="
          right:
            expr_kind: literal
            struct:
              - name:
                  lexeme: bar
                value:
                  expr_kind: literal
                  real: 0.0
        - stmt_kind: return
          value:
            expr_kind: equality
            left:
              expr_kind: access
              type: dot
              left:
                expr_kind: access
                type: identity
                lexeme: foo
              lexeme: bar
            op:
              type: not_equal
              token: "!="
            right:
              expr_kind: literal
              real: 5.0
    ```
    
    opened by imlazyeye 4
Owner
gabe weiner
game developer working with gamemaker and rust
gabe weiner
Language Server Protocol (LSP) support for vim and neovim.

For legacy python implementation, see branch master. LanguageClient-neovim Language Server Protocol support for vim and neovim. More recordings at Upd

Junfeng Li 3.5k Dec 29, 2022
An experimental proofreading and linting language server for markdown files ✍️

prosemd is an experimental proofreading and linting language server for markdown files. It aims to provide helpful and smart diagnostics when writing

Phil Pluckthun 132 Dec 14, 2022
Vim-fork focused on extensibility and usability

Documentation | Chat | Twitter Neovim is a project that seeks to aggressively refactor Vim in order to: Simplify maintenance and encourage contributio

Neovim 61k Jan 2, 2023
A *seriously* no-bullshit Neovim GUI written in Rust and Tauri

Looking for a shareable component template? Go here --> sveltejs/component-template svelte app This is a project template for Svelte apps. It lives at

null 13 Nov 21, 2022
A simple, plug-and-play Rust-implementation of D3vd/Meme_API

?? Rua A simplified Rust-implementation of D3vd/Meme_API. You can self-host this with ease through Docker, but you can also opt to use our free servic

Mihou 1 Dec 22, 2021
Lisp and Rust in a text editor => Crispmacs

crispmacs crispmacs is a WIP implementation of Emacs from scratch in Rust. It consists of two parts: crisp and the editor. Crisp crisp is a Lisp that'

rust 3 Jul 31, 2022
This tool allows you to create the files needed for a Visual Studio project so that you can continue coding on a Mac for C++ with Visual Studio Code and then submit the Visual Studio project for Class Assignments

This tool allows you to create the files needed for a Visual Studio project so that you can continue coding on a Mac for C++ with Visual Studio Code and then submit the Visual Studio project for Class Assignments

cameron 3 Jan 18, 2023
IDE tools for writing pest grammars, using the Language Server Protocol for Visual Studio Code, Vim and other editors

Pest IDE Tools IDE support for Pest, via the LSP. This repository contains an implementation of the Language Server Protocol in Rust, for the Pest par

pest 20 Apr 8, 2023
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Multiplex server for rust-analyzer, allows multiple LSP clients (editor windows) to share a single rust-analyzer instance per cargo workspace

ra-multiplex   Multiplex server for rust-analyzer, allows multiple LSP clients (editor windows) to share a single rust-analyzer instance per cargo wor

max 95 Dec 29, 2022