Skip to content
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

[FEATURE] Add Ruff support #7

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open

Conversation

PSU3D0
Copy link

@PSU3D0 PSU3D0 commented May 19, 2023

Ruff is a next generation python linter written in Rust.

It achieves near parity with the default Flake8 ruleset, and also implements dozens of Flake8 plugins. It also supports rules from isort and pylint.

Performance
image

In CI environments that run linting, there can be a substantial performance improvement when solely using Ruff, especially on larger codebases

This PR brings Ruff to lintball :D

@elijahr
Copy link
Owner

elijahr commented May 22, 2023

Thanks so much for this contribution! If you'd like to pair on writing the unit tests sometime that would be fun. Otherwise I can add the test coverage myself, up to you.

@elijahr
Copy link
Owner

elijahr commented May 24, 2023

Regarding your offline question about test-specific .lintballrc: each lintball test operates in a temp directory with some basic fixture files installed. This project uses a framework called BATS for testing and it lets you run setup & teardown functions per-file and per every function in a file. A test can individually override those default fixtures simply by replacing the files. You can look at the .bats files in the repo to see what's going on.

Lintball tests run on Linux in GitHub actions so you can look at the .github/workflows/*.yml files to see how it's setup to run tests. Worst case, you can enable actions in your fork and run tests on GitHub via pushes.

I have an in-progress branch to move everything into pre built Dockers. This will make it easier to run the tests. That's going to be in lintball 1.7.0 or 1.8.0, though it's not my top priority at the moment.

Looking at the docs, ruff only covers some of pylint, but "near-parity" with flake8 (via autoflake). I am curious if the tests would pass if you simply replaced autoflake with ruff in lintball, run in the same order the python checkers run now (order is important).

The tool installers in lintball should be updated to install ruff. The clippy and luau tools are both rust-based so you could follow the pattern there.

If you get tests running and want to filter to specific tests you can, via:

npm run test -- --filter="some regex"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants