The uncompromising Python code formatter
This report summarizes scanner evidence for psf/black, a Python project with 41,890 GitHub stars. SynthScan examined 99,719 lines of code across 464 source files, recording 1002 pattern matches distributed across 16 syntactic categories. The legacy adjusted pattern signal is 12.4 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 595 finding(s).
Are imports declared and package/API names verified? 278 finding(s).
Are wrappers, guards, and repeated structures necessary? 602 finding(s).
Which changes need focused human review? 1002 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 1002 distinct pattern matches across 16 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_ranges.py | 16 | def test_parse_line_ranges_valid( | CODE |
| LOW | tests/test_ranges.py | 31 | def test_parse_line_ranges_invalid(lines_str: list[str]) -> None: | CODE |
| LOW | tests/test_ranges.py | 51 | def test_repeated_lines_map_to_their_original_positions(start: int, end: int) -> None: | STRING |
| LOW | tests/test_ranges.py | 60 | def test_repeated_lines_between_disjoint_ranges_stay_unselected() -> None: | STRING |
| LOW | tests/test_ranges.py | 246 | def test_diff_at_the_start_of_the_file( | STRING |
| LOW | tests/optional.py | 107 | def pytest_collection_modifyitems(config: "Config", items: "list[Node]") -> None: | CODE |
| LOW | tests/util.py | 341 | def read_jupyter_notebook_from_file(file_name: Path) -> str: | CODE |
| LOW | tests/test_docs.py | 59 | def test_feature_lists_are_up_to_date() -> None: | CODE |
| LOW⚡ | tests/test_ipynb.py | 66 | def test_trailing_semicolon_with_comment() -> None: | CODE |
| LOW⚡ | tests/test_ipynb.py | 73 | def test_trailing_semicolon_with_comment_on_next_line() -> None: | CODE |
| LOW⚡ | tests/test_ipynb.py | 79 | def test_trailing_semicolon_indented() -> None: | CODE |
| LOW⚡ | tests/test_ipynb.py | 85 | def test_trailing_semicolon_noop() -> None: | CODE |
| LOW⚡ | tests/test_ipynb.py | 211 | def test_long_magic_assignment_is_not_wrapped_in_parentheses( | CODE |
| LOW⚡ | tests/test_ipynb.py | 220 | def test_unmask_cell_raises_when_magic_is_no_longer_recognised() -> None: | CODE |
| LOW⚡ | tests/test_ipynb.py | 226 | def test_cell_magic_with_magic() -> None: | CODE |
| LOW | tests/test_ipynb.py | 48 | def test_create_token_uses_requested_length(n_chars: int) -> None: | CODE |
| LOW | tests/test_ipynb.py | 52 | def test_unmask_cell_raises_when_token_is_not_unique() -> None: | CODE |
| LOW | tests/test_ipynb.py | 178 | def test_input_already_contains_transformed_magic() -> None: | CODE |
| LOW | tests/test_ipynb.py | 244 | def test_cell_magic_with_empty_lines(src: str, expected: str) -> None: | CODE |
| LOW | tests/test_ipynb.py | 272 | def test_cell_magic_with_custom_python_magic( | CODE |
| LOW | tests/test_ipynb.py | 293 | def test_cell_magic_with_custom_python_magic_after_spaces_and_comments_noop( | CODE |
| LOW | tests/test_ipynb.py | 307 | def test_cell_magic_with_magic_noop() -> None: | CODE |
| LOW | tests/test_ipynb.py | 332 | def test_cell_magic_with_invalid_body() -> None: | CODE |
| LOW | tests/test_ipynb.py | 344 | def test_entire_notebook_empty_metadata() -> None: | CODE |
| LOW | tests/test_ipynb.py | 379 | def test_entire_notebook_trailing_newline() -> None: | CODE |
| LOW | tests/test_ipynb.py | 426 | def test_entire_notebook_no_trailing_newline() -> None: | CODE |
| LOW | tests/test_ipynb.py | 473 | def test_entire_notebook_without_changes() -> None: | CODE |
| LOW | tests/test_ipynb.py | 491 | def test_unparseable_notebook() -> None: | CODE |
| LOW | tests/test_ipynb.py | 498 | def test_ipynb_diff_with_change() -> None: | CODE |
| LOW | tests/test_ipynb.py | 511 | def test_ipynb_diff_with_no_change() -> None: | CODE |
| LOW | tests/test_ipynb.py | 524 | def test_cache_isnt_written_if_no_jupyter_deps_single( | CODE |
| LOW | tests/test_ipynb.py | 545 | def test_cache_isnt_written_if_no_jupyter_deps_dir( | CODE |
| LOW | tests/test_ipynb.py | 600 | def test_unable_to_replace_magics(monkeypatch: MonkeyPatch) -> None: | CODE |
| LOW | tests/test_concurrency_manager_shutdown.py | 26 | def test_manager_shutdown_called_for_diff(monkeypatch: Any, tmp_path: Path) -> None: | CODE |
| LOW | tests/test_concurrency_manager_shutdown.py | 35 | def fake_format_file_in_place( | CODE |
| LOW | tests/test_schedule_formatting.py | 17 | def test_formats_all_files_and_reports_counts(tmp_path: Path) -> None: | CODE |
| LOW | tests/test_schedule_formatting.py | 47 | def test_reports_failed_files_without_aborting_the_run( | CODE |
| LOW | tests/test_schedule_formatting.py | 55 | def fake_format_file_in_place( | CODE |
| LOW⚡ | tests/test_black.py | 1675 | def test_required_version_matches_version(self) -> None: | CODE |
| LOW⚡ | tests/test_black.py | 1682 | def test_required_version_matches_partial_version(self) -> None: | CODE |
| LOW⚡ | tests/test_black.py | 1689 | def test_required_version_does_not_match_on_minor_version(self) -> None: | CODE |
| LOW⚡ | tests/test_black.py | 1696 | def test_required_version_does_not_match_version(self) -> None: | CODE |
| LOW⚡ | tests/test_black.py | 1704 | def test_preserves_line_endings(self) -> None: | CODE |
| LOW⚡ | tests/test_black.py | 4007 | def test_assert_equivalent_basic(self) -> None: | CODE |
| LOW⚡ | tests/test_black.py | 4012 | def test_assert_equivalent_del(self) -> None: | CODE |
| LOW⚡ | tests/test_black.py | 4015 | def test_assert_equivalent_strings(self) -> None: | CODE |
| LOW | tests/test_black.py | 150 | def test_fmt_off_reindent_reports_black_not_the_user(tmp_path: Path) -> None: | CODE |
| LOW | tests/test_black.py | 187 | def test_invalid_input_error_includes_path_location(tmp_path: Path) -> None: | CODE |
| LOW | tests/test_black.py | 300 | def test_piping_diff_with_color(self) -> None: | CODE |
| LOW | tests/test_black.py | 321 | def test_piping_diff_with_color_respects_no_color(self) -> None: | CODE |
| LOW | tests/test_black.py | 422 | def test_expression_diff_with_color(self) -> None: | CODE |
| LOW | tests/test_black.py | 442 | def test_detect_pos_only_arguments(self) -> None: | CODE |
| LOW | tests/test_black.py | 450 | def test_detect_debug_f_strings(self) -> None: | CODE |
| LOW | tests/test_black.py | 480 | def test_skip_source_first_line(self) -> None: | CODE |
| LOW | tests/test_black.py | 493 | def test_skip_source_first_line_when_mixing_newlines(self) -> None: | CODE |
| LOW | tests/test_black.py | 503 | def test_skip_source_first_line_with_crlf_newlines(self) -> None: | CODE |
| LOW | tests/test_black.py | 521 | def test_skip_magic_trailing_comma(self) -> None: | CODE |
| LOW | tests/test_black.py | 573 | def test_tab_comment_indentation(self) -> None: | CODE |
| LOW | tests/test_black.py | 814 | def test_report_write_github_outputs(self) -> None: | CODE |
| LOW | tests/test_black.py | 834 | def test_github_output_in_cli(self) -> None: | CODE |
| 403 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_black.py | 1582 | except io.UnsupportedOperation: | CODE |
| HIGH | tests/data/cases/context_managers_autodetect_311.py | 7 | except* Error as e: | CODE |
| HIGH | tests/data/cases/context_managers_autodetect_311.py | 28 | except* Error as e: | CODE |
| HIGH | tests/data/cases/remove_parens.py | 15 | except Exception as e: | CODE |
| HIGH | tests/data/cases/remove_parens.py | 73 | except Exception as e: | CODE |
| HIGH | tests/data/cases/fmtskip_header_bracket_5402.py | 33 | except ( # fmt: skip | CODE |
| HIGH | tests/data/cases/pep_654.py | 4 | except* ExceptionGroup as e: | CODE |
| HIGH | tests/data/cases/pep_654.py | 13 | except* ValueError: | CODE |
| HIGH | tests/data/cases/pep_654.py | 22 | except* Exception: | CODE |
| HIGH | tests/data/cases/import_line_collapse.py | 35 | except Exception: | CODE |
| HIGH | tests/data/cases/import_line_collapse.py | 42 | except Exception: | CODE |
| HIGH | tests/data/cases/import_line_collapse.py | 126 | except Exception: | CODE |
| HIGH | tests/data/cases/import_line_collapse.py | 135 | except Exception: | CODE |
| HIGH | tests/data/cases/tuple_with_stmt.py | 25 | except TypeError: | CODE |
| HIGH | tests/data/cases/pep_654_style.py | 4 | except * ExceptionGroup as e: | CODE |
| HIGH | tests/data/cases/pep_654_style.py | 13 | except *ValueError: | CODE |
| HIGH | tests/data/cases/pep_654_style.py | 62 | except* ExceptionGroup as e: | CODE |
| HIGH | tests/data/cases/pep_654_style.py | 71 | except* ValueError: | CODE |
| HIGH | tests/data/cases/pep_654_style.py | 22 | except *(Exception): | CODE |
| HIGH | tests/data/cases/pep_654_style.py | 80 | except* Exception: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 6 | except: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 12 | except ValueError: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 17 | except* ValueError: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 23 | except (ValueError): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 28 | except* (ValueError): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 34 | except (ValueError) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 39 | except* (ValueError) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 45 | except (ValueError,): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 50 | except* (ValueError,): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 56 | except (ValueError,) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 61 | except* (ValueError,) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 67 | except (ValueError, TypeError, KeyboardInterrupt): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 72 | except* (ValueError, TypeError, KeyboardInterrupt): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 78 | except (ValueError, TypeError, KeyboardInterrupt) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 83 | except* (ValueError, TypeError, KeyboardInterrupt) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 89 | except (ValueError if True else TypeError): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 94 | except* (ValueError if True else TypeError): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 103 | except (ValueError,): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 111 | except* (ValueError,): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 119 | except: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 125 | except ValueError: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 130 | except* ValueError: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 136 | except ValueError: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 141 | except* ValueError: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 147 | except ValueError as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 152 | except* ValueError as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 158 | except (ValueError,): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 163 | except* (ValueError,): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 169 | except (ValueError,) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 174 | except* (ValueError,) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 180 | except (ValueError, TypeError, KeyboardInterrupt): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 185 | except* (ValueError, TypeError, KeyboardInterrupt): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 191 | except (ValueError, TypeError, KeyboardInterrupt) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 196 | except* (ValueError, TypeError, KeyboardInterrupt) as e: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 202 | except ValueError if True else TypeError: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 207 | except* ValueError if True else TypeError: | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 216 | except (ValueError,): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 224 | except* (ValueError,): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 101 | except (TypeError, KeyboardInterrupt): | CODE |
| HIGH | …sts/data/cases/remove_except_types_parens_pre_py314.py | 109 | except* (TypeError, KeyboardInterrupt): | CODE |
| 18 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/optional.py | 30 | CODE | |
| LOW | tests/optional.py | 31 | CODE | |
| LOW | tests/optional.py | 32 | CODE | |
| LOW | tests/optional.py | 33 | CODE | |
| LOW | tests/test_concurrency_manager_shutdown.py | 1 | CODE | |
| LOW | tests/test_schedule_formatting.py | 5 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 2 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 2 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 2 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 2 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 2 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 2 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 15 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 15 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 15 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 15 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 15 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 15 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 26 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 29 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 156 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 156 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 156 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 156 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 156 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 156 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 169 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 169 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 169 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 169 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 169 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 169 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 180 | CODE | |
| LOW | tests/data/cases/preview_comments7.py | 183 | CODE | |
| LOW | tests/data/cases/line_ranges_imports.py | 7 | CODE | |
| LOW | tests/data/cases/line_ranges_imports.py | 8 | CODE | |
| LOW | tests/data/cases/line_ranges_imports.py | 9 | CODE | |
| LOW | tests/data/cases/line_ranges_fmt_off.py | 6 | CODE | |
| LOW | tests/data/cases/line_ranges_fmt_off.py | 32 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 3 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 5 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 5 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 5 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 10 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 10 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 10 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 248 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 250 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 250 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 250 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 254 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 254 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 254 | CODE | |
| LOW | tests/data/cases/comments2.py | 1 | CODE | |
| LOW | tests/data/cases/comments2.py | 4 | CODE | |
| LOW | tests/data/cases/comments2.py | 172 | CODE | |
| LOW | tests/data/cases/comments2.py | 175 | CODE | |
| LOW | tests/data/cases/function2.py | 28 | CODE | |
| LOW | tests/data/cases/function2.py | 91 | CODE | |
| LOW | tests/data/cases/function2.py | 33 | CODE | |
| 164 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_black.py | 1920 | CODE | |
| LOW | tests/test_black.py | 3262 | CODE | |
| LOW | tests/test_blackd.py | 230 | CODE | |
| LOW | tests/data/cases/composition_no_trailing_comma.py | 2 | CODE | |
| LOW | tests/data/cases/composition_no_trailing_comma.py | 188 | CODE | |
| LOW | tests/data/cases/empty_lines.py | 5 | CODE | |
| LOW | tests/data/cases/empty_lines.py | 102 | CODE | |
| LOW | tests/data/cases/composition.py | 2 | CODE | |
| LOW | action/main.py | 117 | CODE | |
| LOW | src/blib2to3/pytree.py | 1060 | CODE | |
| LOW | src/blib2to3/pytree.py | 789 | CODE | |
| LOW | src/blib2to3/pytree.py | 909 | CODE | |
| LOW | src/blib2to3/pytree.py | 920 | CODE | |
| LOW | src/blib2to3/pytree.py | 965 | CODE | |
| LOW | src/blib2to3/pytree.py | 1011 | CODE | |
| LOW | src/blib2to3/pgen2/pgen.py | 132 | CODE | |
| LOW | src/blib2to3/pgen2/pgen.py | 189 | CODE | |
| LOW | src/blib2to3/pgen2/pgen.py | 228 | CODE | |
| LOW | src/blib2to3/pgen2/conv.py | 86 | CODE | |
| LOW | src/blib2to3/pgen2/parse.py | 274 | CODE | |
| LOW | src/blib2to3/pgen2/parse.py | 320 | CODE | |
| LOW | src/blib2to3/pgen2/driver.py | 208 | CODE | |
| LOW | src/blib2to3/pgen2/tokenize.py | 146 | CODE | |
| LOW | src/blackd/client.py | 69 | CODE | |
| LOW | src/blackd/__init__.py | 297 | CODE | |
| LOW | src/black/files.py | 208 | CODE | |
| LOW | src/black/files.py | 350 | CODE | |
| LOW | src/black/parsing.py | 217 | CODE | |
| LOW | src/black/handle_ipynb_magics.py | 454 | CODE | |
| LOW | src/black/handle_ipynb_magics.py | 487 | CODE | |
| LOW | src/black/concurrency.py | 159 | CODE | |
| LOW | src/black/__init__.py | 562 | CODE | |
| LOW | src/black/__init__.py | 830 | CODE | |
| LOW | src/black/__init__.py | 971 | CODE | |
| LOW | src/black/__init__.py | 1115 | CODE | |
| LOW | src/black/__init__.py | 1569 | CODE | |
| LOW | src/black/__init__.py | 1778 | CODE | |
| LOW | src/black/__init__.py | 1782 | CODE | |
| LOW | src/black/brackets.py | 394 | CODE | |
| LOW | src/black/lines.py | 1392 | CODE | |
| LOW | src/black/lines.py | 1494 | CODE | |
| LOW | src/black/lines.py | 1530 | CODE | |
| LOW | src/black/lines.py | 1627 | CODE | |
| LOW | src/black/lines.py | 283 | CODE | |
| LOW | src/black/lines.py | 319 | CODE | |
| LOW | src/black/lines.py | 331 | CODE | |
| LOW | src/black/lines.py | 657 | CODE | |
| LOW | src/black/lines.py | 1020 | CODE | |
| LOW | src/black/lines.py | 1201 | CODE | |
| LOW | src/black/ranges.py | 379 | CODE | |
| LOW | src/black/ranges.py | 292 | CODE | |
| LOW | src/black/trans.py | 1353 | CODE | |
| LOW | src/black/trans.py | 431 | CODE | |
| LOW | src/black/trans.py | 781 | CODE | |
| LOW | src/black/trans.py | 1198 | CODE | |
| LOW | src/black/trans.py | 1536 | CODE | |
| LOW | src/black/trans.py | 2024 | CODE | |
| LOW | src/black/trans.py | 2176 | CODE | |
| LOW | src/black/trans.py | 2211 | CODE | |
| LOW | src/black/trans.py | 2264 | CODE | |
| 24 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/test_ipynb.py | 352 | ' "execution_count": null,\n' | CODE |
| HIGH | tests/test_ipynb.py | 365 | ' "execution_count": null,\n' | CODE |
| HIGH | tests/test_ipynb.py | 387 | ' "execution_count": null,\n' | CODE |
| HIGH | tests/test_ipynb.py | 400 | ' "execution_count": null,\n' | CODE |
| HIGH | tests/test_ipynb.py | 434 | ' "execution_count": null,\n' | CODE |
| HIGH | tests/test_ipynb.py | 447 | ' "execution_count": null,\n' | CODE |
| HIGH | tests/data/cases/preview_long_strings__regression.py | 128 | "xx {xxxxxxxxxxx}/xxxxxxxxxxx.xxx xxxx.xxx && xxxxxx -x " | CODE |
| HIGH | tests/data/cases/preview_long_strings__regression.py | 140 | "xx {xxxxxxxxxxx}/xxxxxxxxxxx.xxx xxxx.xxx && xxxxxx -x " | CODE |
| HIGH | tests/data/cases/preview_long_strings__regression.py | 747 | "xx {xxxxxxxxxxx}/xxxxxxxxxxx.xxx xxxx.xxx && xxxxxx -x " | CODE |
| HIGH | tests/data/cases/preview_long_strings__regression.py | 758 | "xx {xxxxxxxxxxx}/xxxxxxxxxxx.xxx xxxx.xxx && xxxxxx -x " | CODE |
| HIGH | src/blib2to3/pgen2/parse.py | 289 | self.push(t, itsdfa, newstate, context) | CODE |
| HIGH | src/black/__init__.py | 505 | " (which can silenced by 2>/dev/null)." | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/data/cases/docstring_no_string_normalization.py | 40 | Lorem ipsum dolor sit amet. | STRING |
| LOW | tests/data/cases/docstring_no_string_normalization.py | 40 | Lorem ipsum dolor sit amet. | STRING |
| LOW | tests/data/cases/docstring_no_string_normalization.py | 167 | Lorem ipsum dolor sit amet. | STRING |
| LOW | tests/data/cases/docstring_no_string_normalization.py | 167 | Lorem ipsum dolor sit amet. | STRING |
| LOW | tests/data/cases/preview_long_dict_values.py | 25 | r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t" | CODE |
| LOW | tests/data/cases/preview_long_dict_values.py | 25 | r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t" | CODE |
| LOW | tests/data/cases/preview_long_dict_values.py | 186 | r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t" | CODE |
| LOW | tests/data/cases/preview_long_dict_values.py | 186 | r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 587 | some_function_name(argument=r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" r" incididu | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 587 | some_function_name(argument=r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" r" incididu | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 588 | some_function_name(lambda: r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" r" incididun | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 588 | some_function_name(lambda: r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" r" incididun | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 589 | value = some_value if condition else r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" r" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 589 | value = some_value if condition else r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" r" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 591 | some_function_name(argument=r"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " r"tempor incidid | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 591 | some_function_name(argument=r"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " r"tempor incidid | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 1310 | r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 1310 | r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 1316 | r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 1316 | r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 1324 | r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 1324 | r"Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor" | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 1330 | argument=r"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " | CODE |
| LOW⚡ | tests/data/cases/preview_long_strings__regression.py | 1330 | argument=r"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 376 | print(f"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam. {[f'{i}' for i in range(10)]}") | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 376 | print(f"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam. {[f'{i}' for i in range(10)]}") | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 531 | r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t" | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 531 | r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t" | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 563 | s = f'Lorem Ipsum is simply dummy text of the printing and typesetting industry:\'{my_dict["foo"]}\'' | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 1061 | "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam." | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 1061 | "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam." | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 1242 | r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t" | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 1242 | r"Lorem ipsum dolor sit amet, an sed convenire eloquentiam \t" | CODE |
| LOW | tests/data/cases/preview_long_strings__regression.py | 1280 | "Lorem Ipsum is simply dummy text of the printing and typesetting" | CODE |
| LOW | tests/data/cases/docstring.py | 55 | Lorem ipsum dolor sit amet. | STRING |
| LOW | tests/data/cases/docstring.py | 55 | Lorem ipsum dolor sit amet. | STRING |
| LOW | tests/data/cases/docstring.py | 293 | Lorem ipsum dolor sit amet. | STRING |
| LOW | tests/data/cases/docstring.py | 293 | Lorem ipsum dolor sit amet. | STRING |
| LOW | tests/data/cases/module_docstring_2.py | 4 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, | STRING |
| LOW | tests/data/cases/module_docstring_2.py | 4 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, | STRING |
| LOW | tests/data/cases/module_docstring_2.py | 42 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, | STRING |
| LOW | tests/data/cases/module_docstring_2.py | 42 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/data/cases/module_docstring_4.py | 0 | single line module-level docstring should be followed by single newline. | STRING |
| HIGH | tests/data/cases/module_docstring_1.py | 0 | single line module-level docstring should be followed by single newline. | STRING |
| HIGH | tests/data/cases/module_docstring_3.py | 0 | single line module-level docstring should be followed by single newline. | STRING |
| HIGH | tests/data/cases/composition_no_trailing_comma.py | 0 | \ %3d 0 load_fast 1 (x) 2 load_const 1 (1) 4 compare_op 2 (==) 6 load_fast 0 (self) 8 store_attr 0 (x) 10 load_const 0 ( | STRING |
| HIGH | tests/data/cases/composition.py | 0 | \ %3d 0 load_fast 1 (x) 2 load_const 1 (1) 4 compare_op 2 (==) 6 load_fast 0 (self) 8 store_attr 0 (x) 10 load_const 0 ( | STRING |
| HIGH | tests/data/cases/multiline_strings.py | 0 | \ %3d 0 load_fast 1 (x) 2 load_const 1 (1) 4 compare_op 2 (==) 6 load_fast 0 (self) 8 store_attr 0 (x) 10 load_const 0 ( | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/data/empty_pyproject.toml | 1 | # Empty pyproject.toml to use with some tests that depend on Python 3.6 autodiscovery | COMMENT |
| LOW | tests/data/cases/comments8.py | 1 | # The percent-percent comments are Spyder IDE cells. | COMMENT |
| LOW | tests/data/cases/fmtonoff.py | 101 | COMMENT | |
| LOW | tests/data/cases/fmtonoff.py | 201 | #nospaceatall | COMMENT |
| LOW | tests/data/cases/fmtonoff.py | 221 | # fmt: on | COMMENT |
| LOW | tests/data/cases/fmtonoff.py | 361 | # fmt: off | COMMENT |
| LOW | tests/data/cases/fmtonoff.py | 481 | #nospaceatall | COMMENT |
| LOW | tests/data/cases/fmtonoff.py | 501 | # fmt: on | COMMENT |
| LOW | tests/data/cases/line_ranges_preserve_outside_prefix.py | 1 | # flags: --line-ranges=2-10 | COMMENT |
| LOW | tests/data/cases/line_ranges_preserve_outside_prefix.py | 21 | # don't format whitespace | COMMENT |
| LOW | tests/data/cases/line_ranges_preserve_outside_prefix.py | 41 | # don't format whitespace | COMMENT |
| LOW | tests/data/cases/pyi_overload_groups.py | 1 | # flags: --preview --pyi | COMMENT |
| LOW | tests/data/cases/pyi_overload_groups.py | 461 | @overload | COMMENT |
| LOW | tests/data/cases/jupytext_markdown_fmt.py | 1 | # Test that Jupytext markdown comments are preserved before fmt:off/on blocks | COMMENT |
| LOW | tests/data/cases/line_ranges_diff_edge_case.py | 1 | # flags: --line-ranges=10-11 | COMMENT |
| LOW | tests/data/miscellaneous/missing_final_newline.py | 1 | # A comment-only file, with no final EOL character | COMMENT |
| LOW | docs/conf.py | 1 | # | COMMENT |
| LOW | docs/conf.py | 101 | # The language for content autogenerated by Sphinx. Refer to documentation | COMMENT |
| LOW | docs/conf.py | 141 | # Add any paths that contain custom static files (such as style sheets) here, | COMMENT |
| LOW | src/blib2to3/Grammar.txt | 21 | decorator: '@' namedexpr_test NEWLINE | COMMENT |
| LOW | src/blib2to3/Grammar.txt | 201 | comp_for: [ASYNC] 'for' exprlist 'in' or_test [comp_iter] | COMMENT |
| LOW | src/black/ranges.py | 501 | # 2. A single backslash on its own line followed by a comment line. | COMMENT |
| LOW | src/black/trans.py | 1681 | # f-strings but will have the 'f' prefix removed OR (b) substrings | COMMENT |
| LOW | src/black/trans.py | 2521 | # A '.' MUST be followed by an attribute or method name. | COMMENT |
| LOW | src/black/linegen.py | 681 | # assert isinstance(fstring_start, Leaf) | COMMENT |
| LOW | src/black/linegen.py | 2221 | # After wrapping, the with_stmt will look like this: | COMMENT |
| LOW | src/black/linegen.py | 2241 | """Recursively hide optional parens in `with` statements.""" | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/util.py | 65 | except Exception as ve: | CODE |
| LOW | tests/util.py | 74 | except Exception as ve: | CODE |
| LOW | tests/util.py | 128 | except Exception as e: | CODE |
| LOW | tests/util.py | 155 | except Exception as e: | CODE |
| LOW | tests/data/cases/remove_parens.py | 15 | except Exception as e: | CODE |
| LOW | tests/data/cases/remove_parens.py | 73 | except Exception as e: | CODE |
| LOW | tests/data/cases/pep_654.py | 25 | except Exception as e: | CODE |
| LOW | tests/data/cases/pep_654.py | 37 | except Exception as e: | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 126 | except Exception: | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 135 | except Exception: | CODE |
| LOW | tests/data/cases/import_line_collapse.py | 35 | except Exception: | CODE |
| LOW | tests/data/cases/import_line_collapse.py | 42 | except Exception: | CODE |
| LOW | tests/data/cases/pep_654_style.py | 25 | except Exception as e: | CODE |
| LOW | tests/data/cases/pep_654_style.py | 38 | except Exception as e: | CODE |
| LOW | tests/data/cases/pep_654_style.py | 83 | except Exception as e: | CODE |
| LOW | tests/data/cases/pep_654_style.py | 95 | except Exception as e: | CODE |
| LOW | tests/data/miscellaneous/python2_detection.py | 60 | except Exception as err: | CODE |
| LOW | action/main.py | 213 | except Exception as e: | CODE |
| LOW | src/blackd/__init__.py | 213 | except Exception as e: | CODE |
| LOW | src/black/__init__.py | 962 | except Exception as exc: | CODE |
| LOW | src/black/__init__.py | 1039 | except Exception as exc: | CODE |
| LOW | src/black/__init__.py | 1842 | except Exception as exc: | CODE |
| LOW | src/black/__init__.py | 1852 | except Exception as exc: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/data/cases/comments2.py | 10 | __all__ = [ | CODE |
| LOW | tests/data/cases/comments2.py | 181 | __all__ = [ | STRING |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 4 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 11 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 17 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 24 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 97 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 105 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 112 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | tests/data/cases/import_line_collapse.py | 117 | logger = logging.getLogger(__name__) | CODE |
| LOW | scripts/release.py | 178 | def update_version_in_docs(self) -> None: | CODE |
| LOW | scripts/diff_shades_gha_helper.py | 42 | def set_output(name: str, value: str) -> None: | CODE |
| LOW | src/blib2to3/pytree.py | 347 | def set_child(self, i: int, child: NL) -> None: | CODE |
| LOW | src/blib2to3/pytree.py | 457 | def update_sibling_maps(self) -> None: | CODE |
| LOW | src/blib2to3/pgen2/driver.py | 16 | __all__ = ["Driver", "load_grammar"] | CODE |
| LOW | src/blib2to3/pgen2/tokenize.py | 65 | __all__ = [x for x in dir(_token) if x[0] != "_"] + [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/data/cases/pep_572_remove_parens.py | 45 | CODE | |
| MEDIUM | tests/data/cases/pep_572_remove_parens.py | 46 | CODE | |
| MEDIUM | tests/data/cases/pep_572_remove_parens.py | 47 | CODE | |
| MEDIUM | tests/data/cases/pep_572_remove_parens.py | 115 | CODE | |
| MEDIUM | tests/data/cases/pep_572_remove_parens.py | 116 | CODE | |
| MEDIUM | tests/data/cases/pep_572_remove_parens.py | 117 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/data/cases/fmtonoff.py | 41 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 44 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 286 | CODE | |
| LOW | tests/data/cases/fmtonoff.py | 291 | CODE | |
| LOW | tests/data/cases/function.py | 31 | CODE | |
| LOW | tests/data/cases/function.py | 34 | CODE | |
| LOW | tests/data/cases/function.py | 146 | CODE | |
| LOW | tests/data/cases/function.py | 151 | CODE | |
| LOW | src/blib2to3/pytree.py | 495 | CODE | |
| LOW | src/blackd/client.py | 10 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_black.py | 3945 | We don't (yet) formally expose an API (see issue #779), but we should endeavor to | STRING |
| LOW | scripts/fuzz.py | 60 | # (if you want only bounded fuzzing, just use `pytest fuzz.py`) | COMMENT |
| LOW | src/blib2to3/pgen2/pgen.py | 374 | # Can't just return self.arcs == other.arcs, because that | COMMENT |
| LOW | src/black/strings.py | 295 | # Do not introduce or remove backslashes in raw strings, just use double quote | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/black/lines.py | 868 | # Check if the if_stmt's next sibling is a same-name decorated function. | COMMENT |
| LOW | src/black/lines.py | 1660 | # Check if the opening bracket (last leaf of head) has comments that would merge | COMMENT |
| LOW | src/black/trans.py | 1615 | # Check if StringMerger registered any custom splits. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/data/cases/line_ranges_basic.py | 20 | #NOTE: The following indentation is incorrect: | COMMENT |
| LOW | tests/data/cases/line_ranges_basic.py | 86 | #NOTE: The following indentation is incorrect: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …ases/preview_parenthesize_expressions_with_comments.py | 28 | def my_method(self): | CODE |
| LOW | …ases/preview_parenthesize_expressions_with_comments.py | 68 | def my_method(self): | CODE |