hume-python-sdk icon indicating copy to clipboard operation
hume-python-sdk copied to clipboard

feat: Migrate to Ruff

Open max-muoto opened this issue 1 year ago • 2 comments

Simplify linting toolchain from migrating away from Pylint, isort, and Black to Ruff. There are still some minor gaps in terms of full pylint support, so feel free to close this out if we feel the fact that not all rules are supported is a blocker here, but in general Ruff is being adopted by a great deal of major Python open-source projects (FastAPI, Pandas, Airflow, etc) and is 10-100x faster than traditional Python linters.

Also, to help with ensuring that modern type hints can be used anywhere, automatically defer annotations in each file.

max-muoto avatar Jun 14 '24 14:06 max-muoto

This is great @max-muoto! Thanks for adding this. Personally, I'm not concerned about lack of full pylint coverage.

Before we merge, will you run ruff format on the existing files in the repo to avoid future messy diffs?

And I'm not sure if you're a vscode user, but will you also update .vscode/settings.json to use ruff instead of black, isort, pylint?

"[python]": { "editor.defaultFormatter": "charliermarsh.ruff" },
"ruff.format.args": ["--config", "pyproject.toml"],

gregorybchris avatar Jun 20 '24 22:06 gregorybchris

This is great @max-muoto! Thanks for adding this. Personally, I'm not concerned about lack of full pylint coverage.

Before we merge, will you run ruff format on the existing files in the repo to avoid future messy diffs?

And I'm not sure if you're a vscode user, but will you also update .vscode/settings.json to use ruff instead of black, isort, pylint?

"[python]": { "editor.defaultFormatter": "charliermarsh.ruff" },
"ruff.format.args": ["--config", "pyproject.toml"],

I thought I did so for some reason, done! I updated the .vscode/settings.json as well, it should automatically use the pyproject.toml, so left that out, but if you prefer to be explicit can tweak things.

max-muoto avatar Jun 22 '24 19:06 max-muoto

Thanks @max-muoto for all your work on this. We've started using a client generator for this SDK and won't be using ruff, but all of your contributions are very appreciated!

gregorybchris avatar Sep 05 '24 16:09 gregorybchris

Thanks @max-muoto for all your work on this. We've started using a client generator for this SDK and won't be using ruff, but all of your contributions are very appreciated!

No worries, thanks!

max-muoto avatar Sep 06 '24 03:09 max-muoto