-
Notifications
You must be signed in to change notification settings - Fork 56
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
Ruff format/fix on save not working in devcontainer until after window reload #501
Comments
I see the same thing happening (settings specified via (I think I also saw this happening for |
Can you provide some additional information?
Do you face this issue when using VS Code locally (not inside devcontainer)? |
I am not sure whether "you" is referring to me or the original poster @eschnitzler but I will leave the keyboard for several weeks within minutes, so I will not be able to investigate this. |
Sorry for the confusion. I'm referring to the issue author @eschnitzler |
@dhruvmanila Here are my ruff configured settings in my [tool.ruff]
exclude = [
".git",
".pytest_cache",
".ruff_cache",
".venv",
".vscode",
"__pypackages__",
"_build",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
line-length = 105
indent-width = 4
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # Error (pycodesyle)
"W", # Warning (pycodesyle)
"F", # pyflakes
"I", # isort
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"Q", # flake8-quotes
"DJ", # flake8-django
"SIM", # flake8-simplify
"UP", # pyupgrade
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"PT", # flake8-ptest-style
"C90", # flake8-mccabe
]
ignore = [
"W191", # Indentation contains tabs
"E111", # Indentation is not a multiple of four
"E114", # Indentation is not a multiple of four (comment)
"E117", # Over-indented
"E501", # Line too long
"Q000", # Remove bad quotes (inline)
"Q001", # Remove bad quotes (multiline)
"Q002", # Remove bad quotes (docstring)
"Q003", # Remove avoidable escaped quote
"ISC001", # Implicit string concatenation (single-line)
"ISC002", # Implicit string concatenation (multi-line)
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"B904", # 'assertRaises' should be used as a context manager
"DJ001" # Avoid using null=True on string-based fields such as CharField and TextField
]
[tool.ruff.lint.per-file-ignores]
"**/tests/**" = ["C90"]
[tool.ruff.format]
docstring-code-format = true
exclude = [
"app/migrations/**",
]
[tool.ruff.lint.mccabe]
max-complexity = 15 The issue only occurs when inside a devcontainer. |
I have the same problem, but reloading VS code does not seem to fix the issue for me. |
I have the same issue. No ruff config, just the extension loaded in a vscode devcontainer. Seems to happen if I save with a bad python file (aka, in the middle of typing or refactoring). A window reload does fix it for me. |
Interesting. This sounds somewhat familiar to #654 (comment) Could you try following the instructions in that thread and share the ruff logs, the status of the server, and if you see any errors in the |
I am encountering an issue with the Ruff VSCode extension where the autofix on save feature does not work initially when using a devcontainer. The feature only starts working after I reload the VSCode window.
Steps to Reproduce:
devcontainer.json
:Expected Behavior:
The Ruff extension should automatically format and fix issues on save without needing to reload the VSCode window first.
Additional Information:
VSCode Version: 1.90.2
Ruff Extension Version: v2024.28.0
Operating System: Pop_Os 22.04
The text was updated successfully, but these errors were encountered: