mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-27 21:32:18 +08:00
Feature: add forge fmt as a fixer for Solidity files (#4598)
* feat: add `forge fmt` as a fixer for Solidity
This commit is contained in:
committed by
GitHub
parent
59e455b4d8
commit
64ddf457e1
@@ -286,6 +286,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['fish'],
|
||||
\ 'description': 'Format fish scripts using fish_indent.',
|
||||
\ },
|
||||
\ 'forge': {
|
||||
\ 'function': 'ale#fixers#forge#Fix',
|
||||
\ 'suggested_filetypes': ['solidity'],
|
||||
\ 'description': 'Fix Solidity files with forge fmt.',
|
||||
\ },
|
||||
\ 'gofmt': {
|
||||
\ 'function': 'ale#fixers#gofmt#Fix',
|
||||
\ 'suggested_filetypes': ['go'],
|
||||
|
||||
11
autoload/ale/fixers/forge.vim
Normal file
11
autoload/ale/fixers/forge.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
call ale#Set('solidity_forge_executable', 'forge')
|
||||
|
||||
function! ale#fixers#forge#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'solidity_forge_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' fmt %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user