Closed pleirb closed 1 week ago
Probably it will have to integrate with https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff now and remove those old linters.
Probablemente tendrá que integrarse con https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff ahora y eliminar esos viejos linters.
If I find a solution I will publish it, but studying vscode in depth is another of my pending subjects.
Probablemente tendrá que integrarse con https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff ahora y eliminar esos viejos linters.
If I find a solution I will publish it, but studying vscode in depth is another of my pending subjects.
I found a temporary solution, but it would be nice to have some expert confirm if it is the right way to go.
First, add "charliermarsh.ruff"
to the extensions list in ./vscode/extensions.json
Second, install Ruff on the system. In my case, Ubuntu is in version 23.10, and I must do it with:
sudo snap install ruff
Although I have seen that it is possible in other distributions to do it with pip
Third, remove all the obsolete lines (the ones that are marked off) in the file: doodba.xxx.code-workspace
"python.formatting.provider": "none",
"python.linting.flake8Enabled": true,
"python.linting.ignorePatterns": [
"/path/to/your/project/odoo/custom/src/odoo/**/*.py"
],
"python.linting.pylintArgs": [
"--init-hook=\"import sys;sys.path.append('/path/to/your/project/odoo/custom/src/odoo')\"",
"--load-plugins=pylint_odoo"
],
"python.linting.pylintEnabled": true,
Fourth, uninstall the extensions
ms-python.pylint
and ms-python.flake8
Fifth, update your template to get the .ruff.toml
configuration file
copier copy gh:Tecnativa/doodba-copier-template ./ --trust
Hello community! Question, is there any intention to repair the code-workspace extension file to fix the problems that appear with the latest version of Visual Studio Code (1.90.1)?
Currently it does not correct my code as it should and I am not being able to debug correctly
We haven't dug on that for now, but feel free to propose the corresponding patch.
Thanks, at the moment what version of Visual Studio Code is recommended to use without problems?
I'm using with the latest and I have warnings and errors. Which ones do you mean?
The problems that appear are from library imports and therefore the correction is wrong. I guess it has to do with the linting
problem
But if I'm not wrong, this wasn't working before either.
Pero si no me equivoy, esto tampoco estaba funcionando antes.
And what advantage of use could Visual Studio Code have if it is integrated into the code-workspace file generated by dodba copier template if ruff is integrated and the old linters are eliminated as suggested by @yajo
ruff is one thing, and import
sentences another different one.
Ruff es una cosa, y
import
oro a otra diferente.
Sorry for my ignorance, yes, it is a code formatter, the thing is that I assumed that this tool works well if it manages to import all the libraries and maybe it had some automatic way to do it or based on the configuration file (code-workspace
)
ruff
is run when you run manually pre-commit or automatic if you configure the repository, but it's not directly attached to VSCode IDE. You may want to do it on IDE file save, but it's not put (it was not either when using previous linter + formatter, as having pre-commit is enough).
ruff
se ejecuta cuando se ejecuta manualmente pre-commito o automático si configura el repositorio, pero no está conectado directamente a VSCode IDE. Usted puede querer hacerlo en el archivo IDE guardado, pero no se pone (no fue ni cuando se usaba linter anterior formatter, ya que tener pre-comprometer es suficiente).
Thanks, for the moment then I guess I won't miss anything if I remove the flake8Enabled, pylintEnabled lines from the code-workspace file and the chrome extension from .vscode/extensiions.json These two things are what were bothering me with warnings when launching Visual Studio Code every day
After so much time it seems that uninstalling the ms-python.python extension and installing it again apparently causes ms-python.black-formatter to also be installed, thus solving the warning problem
When starting vscode in a doodba copier template project, this appears in the lower right corner:
Translation: You have stopped using linting or formatting settings for Python. See logs for more details. And it directs us to this link: https://github.com/microsoft/vscode-python/wiki/Migration-to-Python-Tools-Extensions
Removing these two lines from doodba.XXX.code-workspace:
The message disappears, but continues without the useful correction functionality