{"id":7233,"library":"flake8-picky-parentheses","title":"flake8-picky-parentheses","description":"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.","status":"active","version":"0.6.2","language":"en","source_language":"en","source_url":"https://github.com/robsdedude/flake8-picky-parentheses","tags":["flake8","linter","code style","parentheses","brackets","braces","redundancy","alignment","plugin"],"install":[{"cmd":"pip install flake8-picky-parentheses flake8","lang":"bash","label":"Standard installation"},{"cmd":"flake8 --require-plugins flake8-picky-parentheses <path/to/your/code>","lang":"bash","label":"Using flake8's --require-plugins (flake8 >= 5.0.0)"}],"dependencies":[{"reason":"This is a plugin for flake8 and requires flake8 to run its checks.","package":"flake8"}],"imports":[],"quickstart":{"code":"import os\n\ndef my_function():\n    if (True):  # PAR001: Redundant parentheses (general)\n        result = ((1 + 2) * 3)  # PAR001: Redundant parentheses (general)\n    else:\n        result = (\n            4 + 5 # PAR101: Opening bracket is last, but closing is not on new line\n        ) * 6\n\n    (a,) = 'b' # PAR002: Parentheses used for tuple unpacking\n    return a","lang":"python","description":"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."},"warnings":[{"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.","message":"The alignment checks (PAR1xx codes) provided by `flake8-picky-parentheses` are opinionated and may not align with all coding styles or formatters (e.g., Black).","severity":"gotcha","affected_versions":"All versions"},{"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`.","message":"When 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.","severity":"gotcha","affected_versions":"< 5.0.0 of flake8"},{"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.","message":"`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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"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'.","cause":"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.","error":"flake8: error: unrecognized arguments: --select=PAR0,PAR1"},{"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.","cause":"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.","error":"PAR101: Opening bracket is last, but closing is not on new line"}]}