Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ repos:
language: system
types_or: [python, pyi, jupyter]
require_serial: true
- id: ty
name: ty
description: "Run 'ty' for Python type checking"
entry: ty check
language: system
types: [python]
require_serial: true
pass_filenames: false

# pre-commit.ci SaaS does not have our Nix environment so we skip Nix-packaged hooks
ci:
skip: [nixfmt, uv-lock, ruff, ruff-format]
skip: [nixfmt, uv-lock, ruff, ruff-format, ty]
Comment thread
cursor[bot] marked this conversation as resolved.
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"recommendations": [
"myriad-dreamin.tinymist",
"ms-python.black-formatter",
"charliermarsh.ruff",
"mkhl.direnv",
"editorconfig.editorconfig",
"timonwong.shellcheck",
"melak47.ninja-syntax",
"semgrep.semgrep"
"semgrep.semgrep",
"astral-sh.ty"
]
}
19 changes: 8 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true,
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
// disable python language server since we're using astral-sh.ty
"python.languageServer": "None",
"notebook.formatOnSave.enabled": true,
"notebook.codeActionsOnSave": {
"notebook.source.fixAll": "explicit",
"notebook.source.organizeImports": "explicit"
},
"tinymist.formatterMode": "typstyle",
"tinymist.systemFonts": false
"tinymist.systemFonts": false,
// Format Python files on save using ruff
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Python Server Disabled, Analysis Settings Ineffective

The Python language server is disabled, making cursorpyright analysis settings ineffective and preventing type checking. Additionally, editor.codeActionsOnSave was removed for Python, disabling automatic fixAll and organizeImports on save.

Fix in Cursor Fix in Web

}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ A template repository implementing Palisade's coding guide. Features:
- Nix + uv + direnv environment for development and CI
- Figures and the paper build in CI
- Lint and format pre-commit hooks
- Python type checking with ty
- VSCode settings and extensions

## Development
Expand Down Expand Up @@ -76,7 +77,7 @@ Use Cursor to edit code. It will suggest extensions to install when you open the
```bash
cd template # automatically loads environment
ninja # builds figures and the paper
git commit # checks format and lints
git commit # checks format, lints, and type checks
```

### Files to know
Expand Down
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
ninja
# Python
uv
ruff
# Typesetting
typst
texlive.combined.scheme-medium
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ dependencies = [
"matplotlib>=3.10.0",
"numpy>=2.2.2",
]
[dependency-groups]
dev = [
"ty>=0.0.1a18",
"ruff>=0.12.5",
]

[tool.pyright]
# disable pyright in favor of ruff
Expand Down
311 changes: 187 additions & 124 deletions uv.lock

Large diffs are not rendered by default.