fix: Use shlex.quote() to lint filepaths containing shell metacharacters

This commit is contained in:
Mir Adnan ALI 2025-02-04 20:32:08 -05:00
parent 674eb109c2
commit 3e8f9aa31c

View file

@ -4,6 +4,7 @@ import subprocess
import sys
import traceback
import warnings
import shlex
from dataclasses import dataclass
from pathlib import Path
@ -44,7 +45,7 @@ class Linter:
return fname
def run_cmd(self, cmd, rel_fname, code):
cmd += " " + rel_fname
cmd += " " + shlex.quote(rel_fname)
returncode = 0
stdout = ""