Feature Request: section headers and footers support multiple lines
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7k
- Forks
- 687
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 2
Description
Currently, I use region folding to nest away and hide my imports:
################################################################################
#region Imports
#===============================================================================
#region stdlib
import sys
#endregion stdlib
#===============================================================================
#===============================================================================
#region third party
import pytest
#endregion third party
#===============================================================================
#endregion Imports
################################################################################
such that they fold into:
################################################################################
#region Imports
#===============================================================================
#region stdlib
#===============================================================================
#===============================================================================
#region third party
#===============================================================================
#endregion Imports
################################################################################
and
################################################################################
#region Imports
################################################################################
It would be really awesome if isort supported multi-line section headers and footers in order to support both fixing and understanding the existence of headers/footers like these.
For config, it would be great if both of these formats were handled (I prefer the array version, but others might not):
import_heading_stdlib = "#===============================================================================\n#region Standard Library\n"
or
import_heading_stdlib = [
"#===============================================================================",
"#region Standard Library",
""
]
Currently if the single string style is used, headers and footers just get repeated.
Currently if the array style is used, all text between and including the square brackets are joined as a string and used.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing isort's existing handling of import_heading configuration, including the single-string and array forms shown in the issue. Verify how headers and footers are currently parsed and emitted; done means both formats preserve multiple lines without repeating headers or joining array syntax incorrectly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100