Skip to content

Commit

Permalink
add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarvid committed Sep 20, 2024
1 parent 8b3ce3a commit 6166e9d
Show file tree
Hide file tree
Showing 4 changed files with 1,422 additions and 1,213 deletions.
8 changes: 3 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"recommendations": [
"ms-python.python",
"ms-python.isort",
"ms-python.flake8",
"ms-python.black-formatter",
"njpwerner.autodocstring",
"charliermarsh.ruff",
"njpwerner.autodocstring"
]
}
}
37 changes: 9 additions & 28 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{
//
// Set correct python path to venv's one
//
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
//`
// Very optional: type checking. Remove the line if your project doesn't really use or respect
// type hints. You should give it a try, though. They're great.
//
"python.analysis.typeCheckingMode": "basic",
//
// Hide .venv from explorer and searchbar
//
"files.watcherExclude": {
"**/.venv/**": true,
"**/__pycache__/**": true
Expand All @@ -23,40 +13,31 @@
"**/.venv/": true,
"**/__pycache__/**": true
},
//
// Linting and formatting
//
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"black-formatter.importStrategy": "fromEnvironment",
"isort.importStrategy": "fromEnvironment",
"flake8.importStrategy": "fromEnvironment",
"isort.args": [
"--settings-path",
"${workspaceFolder}/pyproject.toml"
],
"flake8.args": [
"--config=${workspaceFolder}/.flake8"
],
"editor.rulers": [
100 // if changing line length, also do it in .flake8 and pyproject.toml's [tool.black] section
100
],
"editor.wordWrapColumn": 100,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
//
// Jupyter
//
"jupyter.notebookFileRoot": "${workspaceFolder}",
"jupyter.interactiveWindow.textEditor.executeSelection": true,
// TODO: this setting is showing a deprecation warning. Maybe we should drop it?
"jupyter.generateSVGPlots": true,
"autoDocstring.docstringFormat": "numpy",
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"ruff.organizeImports": true,
"ruff.fixAll": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.lint.run": "onSave"
}
Loading

0 comments on commit 6166e9d

Please sign in to comment.