djlint / djLint

✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
https://djLint.com
GNU General Public License v3.0
664 stars 81 forks source link

[BUG] Cannot specify path to config using $workspaceFolder #838

Closed nullbio closed 1 month ago

nullbio commented 2 months ago
2024-06-10 13:32:18.866 [error] {
    "shortMessage": "Command failed with exit code 2: /home/u/.local/share/pdm/venvs/proj-KPghd4ag-3.12/bin/python3.12 -m djlint - --configuration '${workspaceFolder}/pyproject.toml' --quiet --linter-output-format '<filename>{filename}</filename><line>{line}</line><code>{code}</code><message>{message}</message>'",
    "command": "/home/u/.local/share/pdm/venvs/proj-KPghd4ag-3.12/bin/python3.12 -m djlint - --configuration ${workspaceFolder}/pyproject.toml --quiet --linter-output-format <filename>{filename}</filename><line>{line}</line><code>{code}</code><message>{message}</message>",
    "escapedCommand": "/home/u/.local/share/pdm/venvs/proj-KPghd4ag-3.12/bin/python3.12 -m djlint - --configuration '${workspaceFolder}/pyproject.toml' --quiet --linter-output-format '<filename>{filename}</filename><line>{line}</line><code>{code}</code><message>{message}</message>'",
    "cwd": "/home/u/projects/proj",
    "durationMs": 178.550672,
    "failed": true,
    "timedOut": false,
    "isCanceled": false,
    "isGracefullyCanceled": false,
    "isTerminated": false,
    "isMaxBuffer": false,
    "isForcefullyTerminated": false,
    "exitCode": 2,
    "stdout": "",
    "stderr": "Usage: python -m djlint [OPTIONS] SRC ...\nTry 'python -m djlint -h' for help.\n\nError: Invalid value for '--configuration': Path '${workspaceFolder}/pyproject.toml' does not exist.\n",
    "stdio": [
        null,
        "",
        "Usage: python -m djlint [OPTIONS] SRC ...\nTry 'python -m djlint -h' for help.\n\nError: Invalid value for '--configuration': Path '${workspaceFolder}/pyproject.toml' does not exist.\n"
    ],
    "ipcOutput": [],
    "pipedFrom": []

Would be good if we could use $workspaceFolder in our vscode settings.json to specify paths to config files.

monosans commented 1 month ago

Hi. You can just use path relative to workspace root like so ./pyproject.toml