Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting #3414

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Thumbs.db

# IDEs and editors
/.idea/
/.vscode/

# asv benchmark files
/benchmarks/.asv
Expand Down
17 changes: 10 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.8.4
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: ["--fix"]
- id: ruff-format
types_or: [python, pyi, jupyter]
# The following can be removed once PLR0917 is out of preview
- name: ruff preview rules
id: ruff
types_or: [python, pyi, jupyter]
args: ["--preview", "--select=PLR0917"]
- repo: https://github.com/flying-sheep/bibfmt
rev: v4.3.0
Expand All @@ -19,6 +16,15 @@ repos:
args:
- --sort-by-bibkey
- --drop=abstract
- repo: https://github.com/biomejs/pre-commit
rev: v0.6.1
hooks:
- id: biome-format
additional_dependencies: ["@biomejs/biome@1.9.4"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand All @@ -34,6 +40,3 @@ repos:
- id: detect-private-key
- id: no-commit-to-branch
args: ["--branch=main"]

ci:
autofix_prs: false
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Build Documentation",
"type": "debugpy",
"request": "launch",
"module": "sphinx",
"args": ["-M", "html", ".", "_build"],
"cwd": "${workspaceFolder}/docs",
"console": "internalConsole",
"justMyCode": false,
},
{
"name": "Python: Debug Test",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "internalConsole",
"justMyCode": false,
"env": { "PYTEST_ADDOPTS": "--color=yes" },
"presentation": { "hidden": true },
},
],
}
27 changes: 27 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"[python][toml][json][jsonc]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.fixAll": "explicit",
},
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml",
},
"[json][jsonc]": {
"editor.defaultFormatter": "biomejs.biome",
},
"python.analysis.typeCheckingMode": "basic",
"python.testing.pytestArgs": ["-vv", "--color=yes"],
"python.testing.pytestEnabled": true,
"python.terminal.activateEnvironment": true,
// mirror settings from pyproject-fmt
"evenBetterToml.formatter.indentString": " ",
"evenBetterToml.formatter.columnWidth": 120,
"evenBetterToml.formatter.arrayAutoCollapse": false,
"evenBetterToml.formatter.compactArrays": false,
}
21 changes: 21 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"formatter": {
"indentStyle": "space",
"indentWidth": 4,
},
"overrides": [
{
"include": ["./.vscode/*.json", "**/*.jsonc", "**/asv.conf.json"],
"json": {
"formatter": {
"trailingCommas": "all",
},
"parser": {
"allowComments": true,
"allowTrailingCommas": true,
},
},
},
],
}
Loading
Loading