Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

section headers and footers do not abide by comment_prefix setting #1922

Open
MarximusMaximus opened this issue Apr 25, 2022 · 1 comment
Open

Comments

@MarximusMaximus
Copy link

Section headers and footers do not currently abide by the comment_prefix setting, and as such, can break region folding if used for the section headers/footers as seen below.

example config:

comment_prefix = ""
import_heading_stdlib = "#region Standard Library"
import_footer_stdlib = "#endregion Standard Library"

expected output:

#region Standard Library

import sys

#endregion Standard Library

actual output:

# #region Standard Library

import sys

# #endregion Standard Library
@coatk1
Copy link

coatk1 commented Feb 22, 2023

This does not work for me either. It wont end show the comment.

setup.cfg

[tool.isort]
default_section = THIRDPARTY
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
import_heading_future = Future
import_heading_stdlib = Standard Library
import_heading_thirdparty = Third Party

expected output

# Standard Library
import os
import sys
from datetime import datetime

# Third Party
import pandas as pd
import seaborn as sns

actual output

import os
import sys
from datetime import datetime

import pandas as pd
import seaborn as sns

CLI

isort file.py

Am I missing something? Am I calling this wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants