-
Notifications
You must be signed in to change notification settings - Fork 954
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
use ruff as linter and fix lots of problems #450
Conversation
I like this addition. At first glance it looks good I'm going to pull this branch and test it locally tomorrow and then ill approve |
I think there are some merge conflicts can you resolve these and then I'll merge approve looks good |
@Alek99 Have merged all the change from upstream main branch, please review again and we are about to go. |
Ok I just tried running this code and got an error,
I think when ruff took out the f strings in the compiler/templates.py its causing an error. Does this work locally for you? |
I just ran the unit test and it passed. Will try to revent this change. |
Fixed this error and ready to review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great except for pynecone/compiler/templates.py - let's undo all the changes there. The apps won't run with the code as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks for fixing!
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features:
After these steps, you're ready to open a pull request.
Ruff is a super-fast Python code linter written in Rust. This Pull Request removed the old pydocstyle linter and isort import reorder tool, the ruff documentation said it can be a replacement of these tools.
I also changed
.github/workflows/build.yml
file to let the CI pipeline running correctly ( maybe? ), andCONTRIBUTING.md
to replace pydocstyle lines with ruff check things.With the help from ruff, I changed lots of buggy or unstable code in our code base, included some unused import in non-init files, some meaningless f-string and some missing chars in our docstring.
For editor integration, ruff has a official VS Code Extension and an unofficial PyCharm extension, Vim guys can also use official LSP called ruff-lsp.
For a performance reference, I use hyperfine to benchmark ruff ( with all the features we need turned on ) and flake8 ( with zero plugin ):
Speed up development and CI, make more features with less bugs, let's "rust" it up~