Registry / testing / flake8-picky-parentheses

flake8-picky-parentheses

JSON →
library0.6.2pypypiunverified

flake8-picky-parentheses is a flake8 plugin that enhances code style checks by nitpicking about the usage and alignment of parentheses, brackets, and braces. It provides two main types of checks: identifying redundant parentheses (PAR0xx codes) and enforcing opinionated alignment rules for multi-line expressions (PAR1xx codes). The library is actively maintained, frequently updating to ensure compatibility with the latest Python versions and flake8 releases, with its current version being 0.6.2.

pip install flake8-picky-parentheses flake8
INSTALL
IMPORT
SIG · FLAKE8-PICKY-PAREN
F
flake8-picky-parentheses
testingpythonv0.6.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Create a file named `bad_code.py` with the content above. Run flake8 with `flake8-picky-parentheses` to detect redundant parentheses (PAR0xx) and alignment issues (PAR1xx). The `--select` option ensures only this plugin's errors are shown.

import os def my_function(): if (True): # PAR001: Redundant parentheses (general) result = ((1 + 2) * 3) # PAR001: Redundant parentheses (general) else: result = ( 4 + 5 # PAR101: Opening bracket is last, but closing is not on new line ) * 6 (a,) = 'b' # PAR002: Parentheses used for tuple unpacking return a
Debug
Known issues
gotchaThe alignment checks (PAR1xx codes) provided by `flake8-picky-parentheses` are opinionated and may not align with all coding styles or formatters (e.g., Black).
fix
If PAR1xx errors conflict with your style or formatter, consider disabling them using `flake8 --extend-ignore='PAR1'` or by adding `extend-ignore = PAR1` to your `setup.cfg`, `tox.ini`, or `.flake8` configuration file.
affects: All versions
gotchaWhen using `flake8 --require-plugins flake8-picky-parentheses`, ensure that your `flake8` installation is version 5.0.0 or higher. Older versions do not support this option.
fix
Upgrade `flake8` to version 5.0.0 or newer (e.g., `pip install --upgrade flake8`) or install `flake8-picky-parentheses` directly via `pip install flake8-picky-parentheses` alongside `flake8`.
affects: < 5.0.0 of flake8
gotcha`flake8` plugins, including `flake8-picky-parentheses`, are tied to the Python version on which `flake8` itself is installed. To correctly parse modern Python syntax, ensure `flake8` is installed within a compatible Python environment.
fix
Always install `flake8` and its plugins in the Python environment corresponding to the code you are linting (e.g., `python3.10 -m pip install flake8 flake8-picky-parentheses` for Python 3.10 projects). `flake8-picky-parentheses` supports Python 3.7-3.14.
affects: All versions
Errors
Common errors & fixes
flake8: error: unrecognized arguments: --select=PAR0,PAR1
This error typically indicates that `flake8-picky-parentheses` is not installed or detected by `flake8`, or that you are using an older version of `flake8` that does not support plugin selection via `--select` for uninstalled plugins.
fix
Ensure `flake8-picky-parentheses` is installed in your environment (`pip install flake8-picky-parentheses flake8`). If using `--require-plugins`, ensure `flake8` is at least version 5.0.0. If the plugin is installed but still not found, `flake8 --version` should list `picky-parentheses` under 'Plugins'.
PAR101: Opening bracket is last, but closing is not on new line
The plugin's opinionated alignment checker (PAR1xx group) has detected a style violation where an opening bracket (or parenthesis/brace) on one line does not have its corresponding closing bracket on a new, correctly indented line.
fix
Adjust your code to match the plugin's alignment expectations (e.g., place the closing bracket on a new line with matching indentation). Alternatively, if this rule conflicts with your preferred style or an auto-formatter, disable the specific error code `PAR101` or the entire `PAR1` group using `flake8 --extend-ignore='PAR1'` or in your configuration file.
Upgrade
Version history
0.6.2latest on PyPI · released Jan 10, 2026
Audit
Dependencies
flake8requiredThis is a plugin for flake8 and requires flake8 to run its checks.
Agent activity
6 hits · last 30 days
node
6
Resources
flake8-picky-parentheses — pip install flake8-picky-parentheses · libregistry