-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Labels
needs-infoMore information is needed from the issue authorMore information is needed from the issue author
Description
I am using the VSCODE extension of RUFF to format on save in vscode. And I am using ruff in my Gitlab pipeline to check.
I get different behaviour when the extension does a format in VSCODE compared to if i would do a ruff format from the command line:
The vscode extension does this onSave:
def find_ymax(gef_files: List[GefFileModel]) -> float:
"""Find the highest top level of multiple CPTs"""
top_levels = [
max(gef.elevation[0], gef.ground_level_wrt_reference) for gef in gef_files
]
return max(top_levels)
Whereas ruff format . gives me this:
def find_ymax(gef_files: List[GefFileModel]) -> float:
"""Find the highest top level of multiple CPTs"""
top_levels = [max(gef.elevation[0], gef.ground_level_wrt_reference) for gef in gef_files]
return max(top_levels)
It is really annoying that these two things are fighting each other.
This is my pyproject.toml:
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
line-length = 120
indent-width = 4
target-version = "py312"
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I"]
ignore = []
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"Both methods are using ruff==0.14.0
This is my vscode settings file:
"ruff.importStrategy": "useBundled",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.codeActionsOnSave": {
"source.fixAll": "always"
},
"files.autoSave": "onFocusChange",Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-infoMore information is needed from the issue authorMore information is needed from the issue author