|
| 1 | +[settings] ; required heading for .isort.cfg |
| 2 | +############################################################################### |
| 3 | +# Core behaviour |
| 4 | +############################################################################### |
| 5 | +profile = black ; inherit Black's own import-sorting profile |
| 6 | +line_length = 88 ; match Black's default line length |
| 7 | +multi_line_output = 3 ; vertical-hanging-indent style for long imports |
| 8 | +include_trailing_comma = true ; keep trailing commas so Black can safely re-wrap lines |
| 9 | +from_first = true ; place all "from ... import ..." blocks before plain "import ..." |
| 10 | + |
| 11 | +############################################################################### |
| 12 | +# Section ordering & headings |
| 13 | +############################################################################### |
| 14 | +sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER ; five import groups in this order |
| 15 | +import_heading_future = Future ; header comment emitted above FUTURE imports (if headings enabled) |
| 16 | +import_heading_stdlib = Standard ; header for built-in Stdlib imports |
| 17 | +import_heading_thirdparty = Third-Party ; header for pip-installed packages |
| 18 | +import_heading_firstparty = First-Party ; header for internal 'mcpgateway' code |
| 19 | +import_heading_localfolder = Local ; header for ad-hoc scripts / tests in repo |
| 20 | + |
| 21 | +############################################################################### |
| 22 | +# What belongs where |
| 23 | +############################################################################### |
| 24 | +known_first_party = mcpgateway ; treat "mcpgateway.*" as FIRSTPARTY |
| 25 | +known_local_folder = tests,scripts ; treat these folders as LOCALFOLDER |
| 26 | +# src_paths = src/mcpgateway ; uncomment only if package moves under src/ |
| 27 | + |
| 28 | +############################################################################### |
| 29 | +# Style niceties |
| 30 | +############################################################################### |
| 31 | +force_sort_within_sections = true ; always alphabetise names inside each block |
| 32 | +order_by_type = false ; don't group imports by "type vs. straight name" |
| 33 | +balanced_wrapping = true ; spread wrapped imports evenly between lines |
| 34 | +lines_between_sections = 1 ; exactly one blank line between the five groups |
| 35 | +lines_between_types = 1 ; one blank line between "import X" and "from X import ..." (if mixed) |
| 36 | +no_lines_before = LOCALFOLDER ; suppress blank line *before* the LOCALFOLDER block |
| 37 | +ensure_newline_before_comments = true ; insert a newline before any inline # comment after an import |
| 38 | + |
| 39 | +############################################################################### |
| 40 | +# Ignore junk we never want to touch |
| 41 | +############################################################################### |
| 42 | +extend_skip = .md,.json,.yaml,.yml,dist,build,.venv,.tox,*.tmp,*.bak ; files & dirs to never rewrite |
| 43 | +skip_glob = **/__init__.py ; leave namespace init files alone |
| 44 | + |
| 45 | +# ---- Optional CI toggles ---------------------------------------------------- |
| 46 | +# check_only = true ; dry-run mode: exit non-zero if files would change |
| 47 | +# verbose = true ; print every file name processed |
| 48 | +# case_sensitive = true ; treat upper/lowercase differences as significant |
0 commit comments