-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.isort.cfg
More file actions
224 lines (190 loc) · 7.63 KB
/
.isort.cfg
File metadata and controls
224 lines (190 loc) · 7.63 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# =============================================================================
# isort Configuration
# =============================================================================
#
# isort: Python import sorter and organizer
# Documentation: https://pycqa.github.io/isort/
#
# -----------------------------------------------------------------------------
# Usage
# -----------------------------------------------------------------------------
#
# Check imports:
# poetry run isort --check-only src/
#
# Fix imports:
# poetry run isort src/
#
# Preview changes:
# poetry run isort --diff src/
#
# Single file:
# poetry run isort src/swing/package/module.py
#
# -----------------------------------------------------------------------------
# Multi-line Output Modes (multi_line_output)
# -----------------------------------------------------------------------------
#
# 0 = Vertical Hanging Indent (single line if fits, otherwise vertical)
# 1 = Vertical (one import per line, all indented)
# 2 = Hanging Indent (continuation lines indented)
# 3 = Vertical Hanging Indent + Trailing Comma [BLACK COMPATIBLE]
# 4 = Vertical (hanging indent from parenthesis)
# 5 = Vertical Grid Grouped (grouped from statement, hanging after)
#
# =============================================================================
[settings]
# =============================================================================
# Black Compatibility
# =============================================================================
#
# Using `profile = black` enables Black-compatible formatting.
# This sets: multi_line_output=3, include_trailing_comma=True,
# force_grid_wrap=0, use_parentheses=True, line_length=88.
# We override line_length to match our PEP 8 preference (79 chars).
#
# -----------------------------------------------------------------------------
profile = black
line_length = 79
# =============================================================================
# Multi-line Formatting
# =============================================================================
#
# multi_line_output = 3:
# from package import (
# first,
# second,
# third,
# )
#
# include_trailing_comma: Always add trailing comma for cleaner diffs
# force_grid_wrap = 0: Only wrap when exceeds line_length
# use_parentheses: Use parentheses for line continuation
# split_on_trailing_comma: Honor trailing commas as wrap hints
#
# -----------------------------------------------------------------------------
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
split_on_trailing_comma = true
# =============================================================================
# Comments & Whitespace
# =============================================================================
#
# ensure_newline_before_comments: Blank line before inline comments
#
# -----------------------------------------------------------------------------
ensure_newline_before_comments = true
# =============================================================================
# Skip Patterns
# =============================================================================
#
# skip_gitignore: Respect .gitignore patterns
# skip: Directories to always skip (build artifacts, caches, etc.)
# extend_skip: Additional files to skip beyond defaults
# extend_skip_glob: Glob patterns for additional skipping
#
# -----------------------------------------------------------------------------
skip_gitignore = true
skip = .eggs,.git,.hg,.mypy_cache,.nox,.tox,.venv,venv,_build,buck-out,build,dist,public,htmlcov,site,node_modules,bup,wip,tmp,migrations,vendor
extend_skip = conftest.py
extend_skip_glob = **/fixtures/*
# =============================================================================
# Import Classification & Sections
# =============================================================================
#
# isort groups imports into sections. The default order is:
# FUTURE → STDLIB → THIRDPARTY → FIRSTPARTY → LOCALFOLDER
#
# We add DJANGO as a custom section between STDLIB and THIRDPARTY.
#
# known_first_party: Packages that belong to this project
# known_third_party: Override detection for specific packages
#
# Note: `swing` covers all swing.* namespace packages (portable).
#
# -----------------------------------------------------------------------------
known_first_party = swing
known_third_party = celery,rest_framework
# Define Django section (required when DJANGO is in sections)
known_django = django
sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
# =============================================================================
# Section Headers (Optional)
# =============================================================================
#
# Add comment headers above each import section for visual organization.
# Uncomment import_heading_firstparty to label your package imports.
#
# Example output:
#
# # Import | Future
# from __future__ import annotations
#
# # Import | Standard Library
# import os
# from pathlib import Path
#
# # Import | Libraries
# import requests
#
# -----------------------------------------------------------------------------
import_heading_future = Import | Future
import_heading_stdlib = Import | Standard Library
import_heading_thirdparty = Import | Libraries
import_heading_localfolder = Import | Local
; Uncomment for section headers on Django and first-party imports:
; import_heading_django = Import | Django
; import_heading_firstparty = Import | Package
# =============================================================================
# Sorting Behavior
# =============================================================================
#
# force_alphabetical_sort_within_sections:
# Sort imports alphabetically within each section
#
# force_sort_within_sections:
# Sort by module regardless of import type (import vs from)
#
# honor_noqa:
# Respect `# noqa` and `# isort:skip` comments
#
# atomic:
# Only write files if no syntax errors are introduced
#
# remove_redundant_aliases:
# Remove `import foo as foo` redundancies
#
# group_by_package:
# Group imports from the same package together
#
# float_to_top:
# Move imports to the top of the file (after module docstring)
#
# -----------------------------------------------------------------------------
force_alphabetical_sort_within_sections = true
force_sort_within_sections = true
honor_noqa = true
atomic = true
remove_redundant_aliases = true
group_by_package = true
float_to_top = true
# =============================================================================
# Source Discovery
# =============================================================================
#
# src_paths: Where to look for first-party modules
#
# -----------------------------------------------------------------------------
src_paths = src
# =============================================================================
# Output & Debugging
# =============================================================================
#
# color_output: Colorize terminal output for readability
#
# Note: show_diff is deprecated in isort 5.x, use --diff CLI flag instead
#
# -----------------------------------------------------------------------------
color_output = true