orix icon indicating copy to clipboard operation
orix copied to clipboard

Adding Visual Studio Code settings file with suggested settings

Open hakonanes opened this issue 6 months ago • 2 comments

I've become a fan of running code formatting on save in my editor (VS Code). We could add a .vscode/settings.json file with settings for the orix project to the repository. Only suggested to use, but strongly encouraged.

Settings I use:

{
    "python.testing.pytestEnabled": true,
    "python.analysis.typeCheckingMode": "basic",
    "python.analysis.autoImportCompletions": false,
    "editor.rulers": [
        72,
        88
    ],
    "[python]": {
        "editor.defaultFormatter": "charliermarsh.ruff",
        "editor.codeActionsOnSave": {
            "source.organizeImports.ruff": "explicit"
        },
        "editor.formatOnSave": true,
    },
    "files.exclude": {
        "**/.git": true,
        ".venv": true,
        ".pytest_cache": true,
        "**/__pycache__": true
    }
}

hakonanes avatar Jul 03 '25 13:07 hakonanes

Thought of this when reading https://github.com/pyxem/orix/pull/552#issuecomment-2815983969.

hakonanes avatar Jul 03 '25 13:07 hakonanes

In the above suggested settings, we should use Black instead of Ruff, since Ruff doesn't work well with the Spyder IDE, according to @argerlt: https://github.com/pyxem/orix/issues/568#issuecomment-3033113599

hakonanes avatar Jul 04 '25 04:07 hakonanes