-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.black.toml
More file actions
160 lines (137 loc) · 4.72 KB
/
.black.toml
File metadata and controls
160 lines (137 loc) · 4.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# =============================================================================
# Black Configuration
# =============================================================================
#
# The uncompromising Python code formatter.
# Documentation: https://black.readthedocs.io/
#
# This file is portable - copy to other repos without modification.
#
# -----------------------------------------------------------------------------
# Usage
# -----------------------------------------------------------------------------
#
# Format all Python files:
# black src/ tst/ exe/
#
# Check without modifying (CI mode):
# black --check src/ tst/ exe/
#
# Show diff of changes:
# black --diff src/
#
# Format single file:
# black src/swing/package/module.py
#
# -----------------------------------------------------------------------------
# Philosophy
# -----------------------------------------------------------------------------
#
# Black is opinionated by design - it has very few configuration options.
# This reduces bikeshedding and ensures consistent formatting across projects.
#
# "Any color you like, as long as it's black."
#
# -----------------------------------------------------------------------------
# Integration
# -----------------------------------------------------------------------------
#
# Black works well with:
# - isort: Import sorting (configure with profile = "black")
# - flake8: Linting (disable E501 line length, let Black handle it)
# - pre-commit: Auto-format on commit
#
# =============================================================================
[tool.black]
# =============================================================================
# Line Length
# =============================================================================
#
# Maximum line length. Black defaults to 88, but we use 79 to match PEP 8.
#
# PEP 8 recommends 79 for code, 72 for docstrings/comments.
# This works well for side-by-side diffs and smaller screens.
#
# -----------------------------------------------------------------------------
line-length = 79
# =============================================================================
# Target Python Version
# =============================================================================
#
# Python versions to target. Black uses this to determine which syntax
# features are available (e.g., walrus operator :=, match statements).
#
# Format: List of "pyXY" strings
# Include all supported versions from pyproject.toml
# Note: py314 not yet supported by Black
#
# -----------------------------------------------------------------------------
target-version = ["py312", "py313", "py314", "py315"]
# =============================================================================
# File Selection
# =============================================================================
#
# include: Regex pattern for files to format (default: \.pyi?$)
# extend-exclude: Patterns to exclude in addition to defaults
#
# Black's defaults already exclude:
# .git, .hg, .mypy_cache, .tox, .venv, _build, buck-out, build, dist
#
# -----------------------------------------------------------------------------
include = '\.pyi?$'
# =============================================================================
# Exclusions
# =============================================================================
#
# Extended regex pattern for directories to exclude.
# Uses verbose regex (can span multiple lines with comments).
#
# Note: Use extend-exclude instead of exclude to keep Black's defaults.
#
# -----------------------------------------------------------------------------
exclude = '''
/(
# Version control
\.git
| \.hg
# Python tooling caches
| \.mypy_cache
| \.tox
| \.venv
| __pycache__
# Build outputs
| _build
| buck-out
| build
| dist
# Coverage reports
| htmlcov
# Development scratch directories
| bup
| wip
| tmp
# Django auto-generated files
| migrations
)/
'''
# =============================================================================
# Additional Options (Usually Left as Defaults)
# =============================================================================
#
# skip-string-normalization:
# false (default): Prefer double quotes "
# true: Keep original quote style
#
# skip-magic-trailing-comma:
# false (default): Respect trailing commas as "expand this" hints
# true: Ignore trailing commas, Black decides formatting
#
# preview:
# false (default): Stable formatting only
# true: Enable preview style (may change between versions)
#
# -----------------------------------------------------------------------------
# Uncomment to keep single quotes:
# skip-string-normalization = true
# Uncomment to enable preview features:
# preview = true