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 flake8No compatibility data collected yet for this library.
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.
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.
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`.
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.
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'.
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.