pytorch-image-models icon indicating copy to clipboard operation
pytorch-image-models copied to clipboard

Proposal for Code Linting and Formatting with Ruff

Open Laurent2916 opened this issue 2 years ago • 1 comments

Hi there !

From CONTRIBUTING.md:

Code linting and auto-format (black) are not currently in place but open to consideration

I suggest using ruff's code linter (and new formatter), like in other huggingface's projects, such as transformers. This PR contributes a (somewhat overkill) ruff config in pyproject.toml.

All ruff rules are documented here: https://docs.astral.sh/ruff/rules/ The current config finds 8047 errors, 1982 of them being fixable.

This PR is marked as a draft to initiate discussion and gather feedback before making further modifications to pyproject.toml, CONTRIBUTING.md, pre-commits, or the CI. Your thoughts and suggestions are welcome.

Laurent2916 avatar Nov 16 '23 16:11 Laurent2916

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.