Add two new columns to the get_supported_languages_md function: Repo map and Linter, and check the existence of the SCM file and linter support for each language.

This commit is contained in:
Paul Gauthier (aider) 2024-07-30 12:26:01 -03:00
parent bcd802b6e9
commit 74201dd733

View file

@ -517,16 +517,20 @@ def get_scm_fname(lang):
def get_supported_languages_md():
from grep_ast.parsers import PARSERS
from aider.linter import Linter
res = """
| Language | File extension |
|:--------:|:--------------:|
| Language | File extension | Repo map | Linter |
|:--------:|:--------------:|:--------:|:------:|
"""
data = sorted((lang, ex) for ex, lang in PARSERS.items())
linter = Linter()
for lang, ext in data:
fn = get_scm_fname(lang)
if Path(fn).exists():
res += f"| {lang:20} | {ext:20} |\n"
repo_map = "" if Path(fn).exists() else ""
linter_support = "" if lang in linter.languages else ""
res += f"| {lang:20} | {ext:20} | {repo_map:^8} | {linter_support:^6} |\n"
res += "\n"