mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 09:14:31 +02:00
plugin/efmls-configs: init + tests (#542)
This commit is contained in:
parent
c4354ea9ec
commit
4cd3707e00
7 changed files with 630 additions and 0 deletions
25
helpers/efmls-configs/extract.py
Executable file
25
helpers/efmls-configs/extract.py
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
import json
|
||||
|
||||
tool_path = sys.argv[1]
|
||||
|
||||
tools = {
|
||||
"linters": {},
|
||||
"formatters": {},
|
||||
}
|
||||
|
||||
for kind in ["linters", "formatters"]:
|
||||
for file in os.listdir(tool_path + "/" + kind):
|
||||
tool_name = file.removesuffix(".lua")
|
||||
languages = []
|
||||
with open(tool_path + "/" + kind + "/" + file) as f:
|
||||
for line in f.readlines():
|
||||
if line.startswith("-- languages:"):
|
||||
languages = line.split(":")[1].strip().split(",")
|
||||
break
|
||||
tools[kind][tool_name] = languages
|
||||
|
||||
print(json.dumps(tools, indent=4))
|
Loading…
Add table
Add a link
Reference in a new issue