skillfed

flake8-picky-parentheses

flake8 plugin to nitpick about parenthesis, brackets, and braces

flake8-picky-parentheses v0.6.2 293.6K downloads/30d#7,953 on PyPI9
Permissive license Apache License 2.0 Active released

What it is and what it does

Picky Parentheses is a flake8 plugin that adds two independent checkers to your linting workflow. The first detects redundant parentheses, brackets, and braces—pairs that can be safely removed without changing code semantics—while respecting exceptions like tuple literals, operator precedence hints, and multi-line expressions. The second checker enforces opinionated alignment rules for these delimiters, flagging cases where opening and closing brackets don't align properly across lines.

The plugin uses Python's tokenize and ast modules to determine redundancy by attempting to remove each pair and verifying the code still compiles to the same AST. Both checkers emit distinct error codes (PAR0xx for redundancy, PAR1xx for alignment), so you can selectively enable or disable either one. It supports Python 3.7 through 3.14 and integrates directly into flake8's standard workflow.

Use it for:

  • Enforce consistent parenthesis style across a team codebase by catching unnecessary delimiters that clutter readability.
  • Catch alignment mistakes in multi-line function calls, list literals, and conditional expressions during code review.
  • Selectively enable only the redundancy checker (PAR0) if you prefer not to enforce the opinionated alignment rules.
  • Identify tuple unpacking mistakes where parentheses are used incorrectly in assignment expressions.
  • Maintain consistent bracket alignment in complex nested structures like comprehensions and dictionary definitions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A flake8 plugin that detects and reports redundant parentheses, brackets, and braces, plus enforces alignment rules for these delimiters.

Yes. This is a low-friction, actively maintained flake8 plugin with no known vulnerabilities, permissive licensing, and clear error codes that let you tune enforcement to your team's preferences. Install it if your codebase would benefit from stricter parenthesis hygiene; disable the alignment checker (PAR1) if you find it too opinionated.

Install

flake8-picky-parentheses on PyPI

pip

pip install flake8-picky-parentheses

uv

uv add flake8-picky-parentheses

poetry

poetry add flake8-picky-parentheses

Installing flake8-picky-parentheses

Before you install

Low friction: pure Python wheel with only flake8 as a runtime dependency. Actively maintained as of 2026-01-10, with recent commits and no archived status.

License in practice

Apache License 2.0 is permissive; you can use this plugin freely in commercial and private projects with minimal restrictions.

Quickstart

pip install flake8-picky-parentheses

flake8 --select='PAR0,PAR1' '<path/to/code>'

# Or to disable the opinionated alignment checker:
flake8 --extend-ignore='PAR1' '<path/to/code>'

Requires flake8 to be installed; flake8 >= 5.0.0 is needed if you want to use the --require-plugins option.

Verify before relying

  • Whether the plugin's AST-based redundancy detection handles all edge cases in practice across real codebases.
  • Performance impact when running on large projects with many files.

Package facts

License Apache License 2.0 (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — flake8
Maintenance actively maintained — 216 days since the last release
Last repo commit
First released
Downloads 293,554/month — #7,953 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flake8_picky_parentheses-0.6.2-py3-none-any.whl

Keywords: flake8, plugin, redundant, superfluous, extraneous, unnecessary, parentheses, parenthesis, parens, brackets, linter, linting, codestyle, code style

Environment :: ConsoleFramework :: Flake8Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Tags

flake8 parentheses linterredundant parentheses checkerbracket alignment linterflake8 code style pluginparentheses linting toolflake8 quality assurancebrace alignment checker
flake8-plugincode-stylelinting

More Python Modules packages