hpyproject / hpy

HPy: a better API for Python
https://hpyproject.org
MIT License
1.02k stars 52 forks source link

GitHub Action to lint Python code #417

Closed cclauss closed 1 year ago

cclauss commented 1 year ago

As suggested at https://github.com/hpyproject/hpy/wiki/dev-call-20201105#topics-deferred-to-the-next-dev-call

Ruff supports over 500 lint rules including bandit, isort, pylint, pyupgrade, and flake8 plus its plugins, and is written in Rust for speed.

The ruff Action uses minimal steps to run in ~10 seconds, rapidly providing intuitive GitHub Annotations to contributors.

image

Python file edits were done with: % ruff --select=E703,E711,E712,F841 --fix .

hodgestar commented 1 year ago

Given that no big changes were required for the current set of rules to pass, I'm happy with the PR as is. I'm also happy with slightly more relaxed rules though.

mattip commented 1 year ago

I think we should reject this PR. The only time code formatting has become a discussion topic is when use of a tool to format code is proposed. This seems to be the flip side of the "code formatters prevent discussions around formatting": to become "code formatters generate unhelpful and long discussions around code formatting".

cclauss commented 1 year ago

Black is a code formatter. Ruff is a linter. Closing.