{
    "name": "SousChef",
    "build": {
        "dockerfile": "Dockerfile",
        "context": "..",
        "args": {
            "CODEQL_VERSION": "latest",
            "SONAR_SCANNER_VERSION": "latest"
        }
    },
    "workspaceFolder": "/workspaces/souschef",
    "shutdownAction": "stopContainer",
    "remoteEnv": {
        "DOCKER_MCP_IN_CONTAINER": "1",
        "JAVA_HOME": "/usr/local/sdkman/candidates/java/current",
        "PATH": "${containerEnv:PATH}:/usr/local/sdkman/candidates/java/current/bin"
    },
    "runArgs": [
        "--env-file=${localWorkspaceFolder}/.env.devcontainer"
    ],
    "features": {
        "ghcr.io/devcontainers/features/common-utils:2": {
            "installZsh": false,
            "installOhMyZsh": false,
            "upgradePackages": false,
            "username": "vscode",
            "userUid": "automatic",
            "userGid": "automatic"
        },
        "ghcr.io/devcontainers/features/git:1": {
            "version": "latest",
            "ppa": false
        },
        "ghcr.io/devcontainers/features/github-cli:1": {
            "version": "latest"
        },
        "ghcr.io/devcontainers/features/ruby:1": {
            "version": "3.1",
            "installGems": "chef"
        },
        "ghcr.io/devcontainers/features/java:1": {
            "version": "21",
            "installMaven": false,
            "installGradle": false
        },
        "ghcr.io/devcontainers/features/node:1": {
            "version": "lts"
        },
        "ghcr.io/devcontainers/features/go:1": {
            "version": "1.24",
            "golangCILintVersion": "1.60.3"
        }
    },
    "customizations": {
        "vscode": {
            "settings": {
                // Python environment configuration
                "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
                "python.testing.pytestEnabled": true,
                "python.testing.unittestEnabled": false,
                "python.testing.pytestArgs": [
                    "tests",
                    "--cov=souschef",
                    "--cov-report=term-missing"
                ],

                // Pylance: Real-time type checking and intellisense
                "python.analysis.typeCheckingMode": "standard",
                "python.analysis.autoImportCompletions": true,
                "python.analysis.completeFunctionParens": true,

                // Ruff: Primary linter and formatter (replaces Black, isort, flake8)
                "[python]": {
                    "editor.formatOnSave": true,
                    "editor.defaultFormatter": "charliermarsh.ruff",
                    "editor.codeActionsOnSave": {
                        "source.fixAll": "explicit",
                        "source.organizeImports": "explicit"
                    }
                },
                "ruff.enable": true,
                "ruff.lint.enable": true,
                "ruff.organizeImports": true,

                // Editor settings
                "files.eol": "\n",
                "files.insertFinalNewline": true,
                "files.trimTrailingWhitespace": true,
                "editor.rulers": [88],
                "editor.tabSize": 4,
                "editor.insertSpaces": true,

                // Terminal configuration
                "terminal.integrated.defaultProfile.linux": "zsh",
                "terminal.integrated.profiles.linux": {
                    "zsh": {
                        "path": "/bin/zsh"
                    }
                },
                "terminal.integrated.enablePersistentSessions": true,
                "terminal.integrated.shellIntegration.enabled": true,

                // Go configuration
                "go.testFlags": ["-v", "-timeout=5m"],
                "go.testEnvVars": {
                    "TF_ACC": "1"
                },
                "go.coverOnSave": false,
                "go.coverOnTestPackage": false
            },
            "extensions": [
                "golang.go",
                "ms-python.python",
                "ms-python.vscode-pylance",
                "charliermarsh.ruff",
                "GitHub.copilot-chat",
                "editorconfig.editorconfig",
                "redhat.vscode-yaml",
                "Shopify.ruby-lsp",
                "SonarSource.sonarlint-vscode",
                "aquasecurityofficial.trivy-vulnerability-scanner",
                "Progress.chef",
                "redhat.ansible",
                "zbr.vscode-ansible",
                "ms-vscode.test-adapter-converter",
                "hashicorp.terraform"
            ]
        }
    },
    "onCreateCommand": "echo 'Container created - Poetry and development tools available'",
    "postCreateCommand": "bash .devcontainer/post-create.sh",
    "postStartCommand": "sudo chmod 666 /var/run/docker.sock 2>/dev/null || true && bash .devcontainer/post-start.sh",
    "remoteUser": "vscode",
    "mounts": [
        {
            "source": "/var/run/docker.sock",
            "target": "/var/run/docker.sock",
            "type": "bind"
        },
        {
            "source": "${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig",
            "target": "/home/vscode/.gitconfig.host",
            "type": "bind"
        },
        {
            "source": "souschef-zsh-history",
            "target": "/home/vscode/.zsh_history",
            "type": "volume"
        }
    ]
}
