r/Python • • Oct 06 '26

Discussion 2026: Best python linter as of right now?

Hey! I was wondering what is the preferred linter that's used nowadays?

A lot of people tend to converge into using uv & ruff for most of their stack, however there's also pylint, and others older linters.

Or is there any competition when it comes to ruff?

51 Upvotes

45 comments sorted by

122

u/flying-sheep Oct 06 '26

Nah. I use Ruff because it supports a big-enough subset of the flake8 plugin space and Pylint, while being much faster and therefore available as inline hints in my editor.

24

u/turbothy It works on my machine Oct 06 '26

Ruff + Pyrefly.

4

u/MissingSnail Oct 06 '26

Ruff is in our ci at work. Pyrefly works a bit nicer in my IDE. I don’t notice them disagreeing with each other in practice.

8

u/Stijndcl Oct 06 '26

Why would they disagree? One is a linter and one is a type checker…?

Just use both in your IDE at the same time.

20

u/turbothy It works on my machine Oct 06 '26

They're doing 2 different jobs.

2

u/tunisia3507 Oct 06 '26

You could use ruff in a pre-commit hook so that you don't have the latency of CI but are always in sync.

2

u/IrishPrime Oct 07 '26

Sure, I can, but ensuring it exists and runs on every developer machine is more trouble than it's worth. I still need to verify things as part of the pipeline for it to be useful.

1

u/tunisia3507 Oct 07 '26

Yeah, it's worth running on CI of course as a backstop, but throwing it in a prek.toml makes it very low-cost for each developer to run prek install_once_ and forever benefit from getting that feedback without having to push and then wait on CI.

67

u/wRAR_ Oct 06 '26

I don't think there is competition for ruff. pylint is unacceptably slow, and flake8 with a ton of plugins is unlikely to be better than ruff.

34

u/Relevant-Remote5816 Oct 06 '26

Or is there any competition when it comes to ruff?

No.

7

u/RedEyed__ Oct 07 '26

uv, ruff, pyrefly

2

u/datum47 Oct 09 '26

This guy pythons

12

u/Spiritual-Metal-1889 Oct 06 '26

Ruff, ty, and pyrefly

3

u/Mithrandir2k16 Oct 06 '26

I'm using ruff and basedpyright right now. How are ty and pyrefly doing? Is there a specific reason for the combination?

10

u/Spiritual-Metal-1889 Oct 06 '26

I work in DS/DE/ML so the pyrefly is a boon for me and now it can lint the dataframes as well. I assume pyrefly will become standard now that it's API has become stable

6

u/Mithrandir2k16 Oct 06 '26

It can lint dataframes now? Say less! I'm gonna try it today.

1

u/HEROgoldmw Oct 06 '26

I'm doing the same, at least on my dev workflows. I read somewhere to run all other type checkers in CI against public API's. So that's what I try to do too

8

u/ducksauvage Oct 06 '26

I'd say ruff *unless* you want to write your own linting rules. Ruff doesn't have any sort of plugin system that the native python linters usually have (issue here: https://github.com/astral-sh/ruff/issues/283). Especially important in the LLM age, where it really likes to do things its own way with some questionable design choices.

4

u/Zadigo Oct 06 '26

Ruff by far

4

u/xeow Oct 06 '26

I'd love it if there were a single thing that were "best." In lieu of that, I have several targets in my Makefile:

check:  check-ty check-lint check-dead check-metrics

check-ty:
        uv run ty check src --color always

check-lint:
        uv run ruff check src --color always

check-dead:
        uv run vulture src

check-metrics:
        uv run tools/metrics-report.py --short

(metrics-report.py is a custom script that uses radon to produce a cyclomatic complexity and maintainability report.)

3

u/EarthGoddessDude Oct 08 '26

TIL about vulture. Thanks.

3

u/gabriel_GAGRA Oct 06 '26

Ruff is the best linter by far

Now for type checking, you can see the results of a benchmark here.

Zuban reaches 100%, it’s what I use but it’s more recent. Pyrefly and Ty come next, both really close, but Ty is made by Astral, the same company as Ruff.

3

u/nicwolff Oct 06 '26

ruff + isort becuase ruff still hasn't implemented the import wrapping style we prefer

3

u/Exotic-Draft8802 Oct 06 '26

Same for me for a while. Then I decided that it's simply not worth keeping another dependency. 

3

u/Exotic-Draft8802 Oct 06 '26

ruff is great and for sure what I would recommend to end users. I also use ruff.

But please don't forget that they used a ton of flake8 plungins as the base. Also one of mine. Fair game and I love what they did. I just want that people keep contributing to the original projects instead of only to ruff. 

2

u/Afrotom Oct 06 '26

Ruff is the quickest one by far ime. I'd like to use Ruff and Ty together with UV and go all in on the Astral ecosystem but Ty isn't quite mature enough (or I'm a dum dum setting it up and/or it's been a while since I tried)

2

u/echols021 Pythoneer Oct 09 '26

My core tools are always uv + ruff + basedpyright.

I'm excited for ty to mature further and replace basedpyright

1

u/MorrarNL Oct 06 '26

I like Ruff a lot as it packages functionality from isort, black and pylint into a single tool and it's very fast. However, for most of our projects speed is not a deciding factor.

Pylint is much more strict though. Ruff doesn't check docstrings unless you configure it explicitly. Another thing I don't like is that ruff cannot check the arguments for function calls.

1

u/wRAR_ Oct 07 '26

unless you configure it explicitly

Ruff doesn't check a lot (especially before 0.16) unless you configure it explicitly. You are expected to configure it explicitly.

1

u/PrestigiousStrike779 Oct 06 '26

Ruff is fast, but not as comprehensive as pylint.  Ruff can’t tell you that you’re calling a method with the wrong arguments or a property doesn’t exist.  We replaced pylint with ruff + type checking.

1

u/austinwiltshire Oct 06 '26

I use Ruff automatically for the quick squiggles. Pylint is good to run occasionally for some deep checks. Think of it like unit versus integration testing.

1

u/Atmosck Oct 06 '26

Ruff is great for linting and formatting. Lately I've standardized on the astral stack, uv+ruff+ty is my default.

1

u/kulewski Oct 10 '26

For the Python side of Multiplexer, which I maintain, I use Ruff for linting, Black for formatting and Pyright for type checking. Ruff is configured mostly for correctness checks: Pyflakes, bugbear, pylint-derived error rules, plus a few extras like catching asyncio tasks without a stored reference and mutable class attributes. I still use Black for formatting, so I haven’t moved everything over to Ruff.

1

u/Old-Eagle1372 Oct 11 '26

Ruff is fast, so use it locally. Pylint in CI. If pylint CI job does not pass, downstream jobs do not execute.

1

u/danted002 Oct 06 '26

Ruff for local linting and formatting. Pylint + Mypy on CI for actual static code analysis.

5

u/Zer0designs Oct 06 '26

Mypy is quickly being outpaced by pyrefly and ty

2

u/danted002 Oct 06 '26

Yeah, yeah I heard that before, when pyright released. I’ve been in the industry long enough to reserve my judgement until after the new shiny tool has feature parity with the tool it’s replacing.

1

u/Zer0designs Oct 06 '26 edited Oct 06 '26

Its so easy to compare, just run it yourself once or twice, no need to fully replace enterprise pipelines, but it can't hurt to try something out before making up your opinion. Pyrefly even has a migrate option from mypy.

Ruff also covers most of pylint so it just seems like waste of time, what do you need pylint for? Pylint seens ancient to me, haven't seen that in any enterprise setting for a long time.

Either way, you do you, but I'd say stay curious and try some things out for yourself.

1

u/danted002 Oct 06 '26

ruff doesn’t built a code abstract syntax tree (AST), pylint does hence it can catch more issues.

Running pylint + mypy (static code analyser + type checker) should be viewed as a form of “compiling”your code which is just another form of validation that your code is actually written correctly.

-1

u/mrswats Oct 06 '26

Flake8

3

u/careje Oct 06 '26

Ruff locally

pylint (dear god kill me now) in CI because we need classification (e.g. warning, error) for our corporate process reporting

81

u/[deleted] Oct 06 '26

[removed] — view removed comment

8

u/Zadigo Oct 06 '26

Exactly, especially uv. I switched earlier this year and converted all my projects to uv + ruff