Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/psf/black
/ types & classes
Types & classes
148 in github.com/psf/black
⨍
Functions
1,067
◇
Types & classes
148
↳
Endpoints
29
↓ 20 callers
Class
Leaf
Concrete implementation for leaf nodes.
src/blib2to3/pytree.py:381
↓ 13 callers
Class
BlackRunner
Make sure STDOUT and STDERR are kept separate when testing Black via its CLI.
tests/test_black.py:118
↓ 12 callers
Class
Ok
src/black/rusty.py:11
↓ 9 callers
Class
Line
Holds leaves and comments. Can be printed with `str(line)`.
src/black/lines.py:48
↓ 8 callers
Class
Node
Concrete implementation for interior nodes.
src/blib2to3/pytree.py:240
↓ 6 callers
Class
CannotSplit
A readable split that fits the allotted line length is impossible.
src/black/linegen.py:83
↓ 6 callers
Class
CannotTransform
Base class for errors raised by Transformers.
src/black/trans.py:61
↓ 6 callers
Class
FakeContext
A fake click Context for when calling functions that need it.
tests/test_black.py:102
↓ 6 callers
Class
StringParser
A state machine that aids in parsing a string's "trailer", which can be either non-existent, an old-style formatting sequence (e.g. `% varX`
src/black/trans.py:2181
↓ 3 callers
Class
Err
src/black/rusty.py:19
↓ 3 callers
Class
ParseError
Exception to signal the parser is stuck.
src/blib2to3/pgen2/parse.py:130
↓ 3 callers
Class
Report
Provides a reformatting counter. Can be rendered with `str(report)`.
src/black/report.py:24
↓ 2 callers
Class
A
tests/data/simple_cases/torture.py:13
↓ 2 callers
Class
DebugVisitor
tests/data/miscellaneous/debug_visitor.py:2
↓ 2 callers
Class
Mode
src/black/mode.py:176
↓ 2 callers
Class
NFAState
src/blib2to3/pgen2/pgen.py:378
↓ 2 callers
Class
OffsetAndMagic
src/black/handle_ipynb_magics.py:358
↓ 2 callers
Class
Replacement
src/black/handle_ipynb_magics.py:53
↓ 1 callers
Class
BlackVersion
gallery/gallery.py:28
↓ 1 callers
Class
BracketMatchError
Raised when an opening bracket is unable to be matched to a closing bracket.
src/black/brackets.py:60
↓ 1 callers
Class
BracketTracker
Keeps track of brackets on a line.
src/black/brackets.py:65
↓ 1 callers
Class
CellMagic
src/black/handle_ipynb_magics.py:311
↓ 1 callers
Class
CellMagicFinder
Find cell magics. Note that the source of the abstract syntax tree will already have been processed by IPython's TransformerManager().tra
src/black/handle_ipynb_magics.py:324
↓ 1 callers
Class
CustomSplit
A custom (i.e. manual) string split. A single CustomSplit instance represents a single substring. Examples: Consider the following s
src/black/trans.py:275
↓ 1 callers
Class
DFAState
src/blib2to3/pgen2/pgen.py:390
↓ 1 callers
Class
DebugVisitor
src/black/debug.py:15
↓ 1 callers
Class
EmptyLineTracker
Provides a stateful method that returns the number of potential extra empty lines needed before and after the currently processed line. Note:
src/black/lines.py:513
↓ 1 callers
Class
FakeParameter
A fake click Parameter for when calling functions that need it.
tests/test_black.py:111
↓ 1 callers
Class
FormatFailure
Used to wrap failures when assert_format() runs in an extra mode.
tests/util.py:60
↓ 1 callers
Class
InvalidInput
Raised when input source code fails all parse attempts.
src/black/parsing.py:47
↓ 1 callers
Class
InvalidVariantHeader
src/blackd/__init__.py:56
↓ 1 callers
Class
LineGenerator
Generates reformatted Line objects. Empty lines are not emitted. Note: destroys the tree it's visiting by mutating prefixes of its leaves in
src/black/linegen.py:89
↓ 1 callers
Class
LinesBlock
Class that holds information about a block of formatted lines. This is introduced so that the EmptyLineTracker can look behind the standalone
src/black/lines.py:491
↓ 1 callers
Class
MagicFinder
Visit cell to look for get_ipython calls. Note that the source of the abstract syntax tree will already have been processed by IPython's
src/black/handle_ipynb_magics.py:365
↓ 1 callers
Class
NodePattern
src/blib2to3/pytree.py:649
↓ 1 callers
Class
ParserGenerator
src/blib2to3/pgen2/pgen.py:32
↓ 1 callers
Class
PgenGrammar
src/blib2to3/pgen2/pgen.py:28
↓ 1 callers
Class
ProtoComment
Describes a piece of syntax that is a comment. It's not a :class:`blib2to3.pytree.Leaf` so that: * it can be cached (`Leaf` objects should n
src/black/comments.py:36
↓ 1 callers
Class
RHSResult
Intermediate split result from a right hand split.
src/black/lines.py:480
↓ 1 callers
Class
Recorder
src/blib2to3/pgen2/parse.py:60
↓ 1 callers
Class
ReleaseRange
src/blib2to3/pgen2/driver.py:52
↓ 1 callers
Class
StringMerger
StringTransformer that merges strings together. Requirements: (A) The line contains adjacent strings such that ALL of the validation chec
src/black/trans.py:362
↓ 1 callers
Class
StringParenStripper
StringTransformer that strips surrounding parentheses from strings. Requirements: The line contains a string which is surrounded by paren
src/black/trans.py:776
↓ 1 callers
Class
StringParenWrapper
StringTransformer that wraps strings in parens and then splits at the LPAR. Requirements: All of the requirements listed in BaseStri
src/black/trans.py:1788
↓ 1 callers
Class
StringSplitter
StringTransformer that splits "atom" strings (i.e. strings which exist on lines by themselves). Requirements: * The line consist
src/black/trans.py:1281
↓ 1 callers
Class
TargetVersion
src/black/mode.py:23
↓ 1 callers
Class
TokenError
src/blib2to3/pgen2/tokenize.py:183
↓ 1 callers
Class
TokenProxy
src/blib2to3/pgen2/driver.py:62
↓ 1 callers
Class
Untokenizer
src/blib2to3/pgen2/tokenize.py:232
↓ 1 callers
Class
WildcardPattern
A wildcard pattern can match zero or more nodes. This has all the flexibility needed to implement patterns like: .* .+ .?
src/blib2to3/pytree.py:718
↓ 1 callers
Class
X
tests/data/simple_cases/trailing_comma_optional_parens1.py:10
↓ 1 callers
Class
_pattern_symbols
src/blib2to3/pygram.py:142
↓ 1 callers
Class
_python_symbols
src/blib2to3/pygram.py:35
Class
A
tests/data/simple_cases/fmtonoff5.py:51
Class
A
tests/data/simple_cases/fmtskip6.py:1
Class
A
tests/data/simple_cases/trailing_comma_optional_parens1.py:18
Class
A
tests/data/miscellaneous/force_pyi.py:6
Class
A
tests/data/preview/long_strings__regression.py:1
Class
ALonelyClass
A multiline class docstring.
tests/data/miscellaneous/docstring_no_string_normalization.py:1
Class
B
tests/data/miscellaneous/force_pyi.py:8
Class
B
tests/data/preview/long_strings__regression.py:36
Class
Base
Abstract base class for Node and Leaf. This provides some default functionality and boilerplate using the template pattern. A node
src/blib2to3/pytree.py:61
Class
BasePattern
A pattern is a tree matching pattern. It looks for a specific node type (token or symbol), and optionally for a specific content. T
src/blib2to3/pytree.py:509
Class
BaseStringSplitter
Abstract class for StringTransformers which transform a Line's strings by splitting them or placing them on their own lines where necessary t
src/black/trans.py:960
Class
BlackBaseTestCase
tests/util.py:141
Class
BlackDTestCase
tests/test_blackd.py:34
Class
BlackTestCase
tests/test_black.py:143
Class
C
tests/data/simple_cases/composition.py:1
Class
C
tests/data/simple_cases/composition_no_trailing_comma.py:1
Class
C
tests/data/simple_cases/comments4.py:9
Class
C
tests/data/miscellaneous/force_pyi.py:13
Class
C
tests/data/preview/comments7.py:84
Class
Changed
src/black/report.py:13
Class
ClassSimplest
tests/data/simple_cases/class_methods_new_line.py:1
Class
ClassSimplestWithInner
tests/data/simple_cases/class_methods_new_line.py:38
Class
ClassSimplestWithInnerWithDocstring
tests/data/simple_cases/class_methods_new_line.py:41
Class
ClassWithDecoInit
tests/data/simple_cases/class_methods_new_line.py:23
Class
ClassWithDecoInitAndVars
tests/data/simple_cases/class_methods_new_line.py:27
Class
ClassWithDecoInitAndVarsAndDocstring
Test class
tests/data/simple_cases/class_methods_new_line.py:32
Class
ClassWithDecoInitAndVarsAndDocstringWithInner
Test class
tests/data/simple_cases/class_methods_new_line.py:85
Class
ClassWithDecoInitAndVarsAndDocstringWithInner2
Test class
tests/data/simple_cases/class_methods_new_line.py:93
Class
ClassWithDecoInitAndVarsWithInner
tests/data/simple_cases/class_methods_new_line.py:78
Class
ClassWithDecoInitWithInner
tests/data/simple_cases/class_methods_new_line.py:72
Class
ClassWithDocstring
A docstring.
tests/data/simple_cases/comments9.py:37
Class
ClassWithDocstring
A docstring.
tests/data/simple_cases/docstring_no_extra_empty_line_before_eof.py:3
Class
ClassWithEmptyFunc
tests/data/simple_cases/class_blank_parentheses.py:8
Class
ClassWithInit
tests/data/simple_cases/class_methods_new_line.py:7
Class
ClassWithInitAndVars
tests/data/simple_cases/class_methods_new_line.py:14
Class
ClassWithInitAndVarsAndDocstring
Test class
tests/data/simple_cases/class_methods_new_line.py:18
Class
ClassWithInitAndVarsAndDocstringWithInner
Test class
tests/data/simple_cases/class_methods_new_line.py:65
Class
ClassWithInitAndVarsWithInner
tests/data/simple_cases/class_methods_new_line.py:59
Class
ClassWithInitWithInner
tests/data/simple_cases/class_methods_new_line.py:54
Class
ClassWithJustTheDocstring
Just a docstring.
tests/data/simple_cases/class_methods_new_line.py:5
Class
ClassWithJustTheDocstringWithInner
Just a docstring.
tests/data/simple_cases/class_methods_new_line.py:50
Class
ClassWithSingleField
tests/data/simple_cases/class_methods_new_line.py:3
Class
ClassWithSingleFieldWithInner
tests/data/simple_cases/class_methods_new_line.py:46
Class
ClassWithSpaceParentheses
tests/data/simple_cases/class_blank_parentheses.py:3
Class
ClassWithTheDocstringAndInit
Just a docstring.
tests/data/simple_cases/class_methods_new_line.py:10
Class
Converter
Grammar subclass that reads classic pgen output files. The run() method reads the tables as produced by the pgen parser generator, typically
src/blib2to3/pgen2/conv.py:38
Class
CustomSplitMapMixin
This mixin class is used to map merged strings to a sequence of CustomSplits, which will then be used to re-split the strings iff none of
src/black/trans.py:301
next →
1–100 of 148, ranked by callers