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

Support yapf ignore configuration in pyproject.toml #904

Closed
dclong opened this issue Mar 15, 2021 · 4 comments · Fixed by #946
Closed

Support yapf ignore configuration in pyproject.toml #904

dclong opened this issue Mar 15, 2021 · 4 comments · Fixed by #946

Comments

@dclong
Copy link

dclong commented Mar 15, 2021

Now that yapf supports formatting configuration in pyproject.toml, it's appealing to support yapf ignore configuration in pyproject.toml too so that we can configure everything about yapf in pyproject.tom.

@dclong
Copy link
Author

dclong commented Jul 13, 2021

@hirosassa
The PR #937 addresses this issue. However, it uses a triple quotes string to specify multiple patterns. It is more nature to allow users to specify a list of patterns. Anyway, the code tries to parse the triple quotes string to a list of patterns. Basically, in addition to the following configuration style,

[tool.yapfignore]
ignore_patterns="""
temp/**/*.py
temp2/*.py
"""

allowing the below configuration style as well.

[tool.yapfignore]
ignore_patterns = [
    "temp/**/*.py",
    "temp2/*.py"
]

@bwendling
Copy link
Member

PR #937 uses the toml module to do the parsing. Does that not have support for a list of patterns?

@hirosassa
Copy link
Contributor

Thanks for your suggestion. I'll try it.

@hirosassa
Copy link
Contributor

@dclong Fixed the issue in #946

@gwelymernans thanks for merging the PR!

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

Successfully merging a pull request may close this issue.

3 participants