Skip to content

bug: [ERROR] Formatter 'mago_lint' error: error: unexpected argument '--format' found #884

Description

@720720

Neovim version (nvim -v)

NVIM v0.12.2

Operating system/version

Windows 11

Read debugging tips

Add the debug logs

  • I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

[ERROR] Formatter 'mago_lint' error: error: unexpected argument '--format' found
Tip: a similar argument exists: '--format-after-fix'
Usage: mago lint --fix --format-after-fix [PATH]

Describe the bug

https://github.com/stevearc/conform.nvim/blob/master/lua/conform/formatters/mago_lint.lua

args = { "lint", "--fix", "--format", "$FILENAME" },

--format causes [ERROR] Formatter 'mago_lint' error: error: unexpected argument '--format' found

args = { "lint", "--fix", "--format-after-fix", "$FILENAME" },

https://mago.carthage.software/latest/en/tools/linter/usage/

--format-after-fix works

What is the severity of this bug?

breaking (some functionality is broken)

Steps To Reproduce

  1. install https://github.com/carthage-software/mago
  2. require("conform").formatters_by_ft.php = { "mago_lint" }
  3. format a php file

Expected Behavior

mago lint fixes the php file

Minimal example file

<?php

if (true) echo "test";

Minimal init.lua

vim.pack.add({
    "https://github.com/stevearc/conform.nvim",
})

require("conform").setup({
    format_on_save = {
        lsp_format = "never",
    },
    formatters_by_ft = {
        php = { "mago_lint" },
    },
})

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions