Back to articles
Sourcery vs Black: Refactoring vs Formatting

Sourcery vs Black: Refactoring vs Formatting

via Dev.toRahul Singh

Quick Verdict Sourcery and Black are two of the most commonly mentioned Python code quality tools, but comparing them directly misses the point - they operate at entirely different layers of code quality and are not alternatives to each other. Black is a Python code formatter. It takes your code and rewrites it so that every line, every bracket, every string quote, and every blank line follows a consistent, opinionated style. It makes no judgment about whether your logic is good, whether your functions are too complex, or whether a loop could be simplified. Black's job is to make your code look consistent. It does that job completely and automatically. Sourcery is an AI-powered code review and refactoring platform. It makes no attempt to format your code - whitespace, indentation, and punctuation are Black's territory. Sourcery analyzes what your code does and asks whether it could do it more cleanly: could this loop be a comprehension, could this condition be simplified, could this fu

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles