Integration of Makefile formatter mbake

Open
#4,995 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
neovim, vim

Research direction

Start in ale_linters/make with the shown ale#linter#Define configuration and compare it with the existing ALE handler entry points. Run mbake validate against a Makefile and inspect how ale#handlers#unix#HandleAsWarning processes its output and colouring. Done means mbake lint diagnostics appear correctly in Neovim while the existing formatter continues to work.

Written by the indexing model from the issue text.

Description

enhancement

I'm trying to integrate the Makefile mbake formatter and validator into ALE to work with Makefiles in Neovim.

I wrote the following custom linter and fixer configuration under ale_linters/make:

" Description: linting using mbake

call ale#linter#Define('make', {
\   'name': 'mbake',
\   'executable': 'mbake',
\   'command': 'mbake validate %s',
\   'callback': 'ale#handlers#unix#HandleAsWarning',
\})

function! FormatMakefile(buffer) abort
    return {
    \   'command': 'mbake format %t',
    \   'read_temporary_file': 1,
    \}
endfunction

execute ale#fix#registry#Add('mbakefmt', 'FormatMakefile', ['lua'], 'mbake for makefiles')

let g:ale_fixers = {
  \ 'makefile': ['mbakefmt']
}

Formatter works but linter does not. Seems to have an issue with the colouring

Dominant language
Vim Script
Stars
14k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dense-analysis/ale

All issues in dense-analysis/ale

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.