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

[Question]yapfignore not working in pyproject.toml #984

Closed
UponTheSky opened this issue Dec 20, 2021 · 3 comments
Closed

[Question]yapfignore not working in pyproject.toml #984

UponTheSky opened this issue Dec 20, 2021 · 3 comments

Comments

@UponTheSky
Copy link

UponTheSky commented Dec 20, 2021

Thank you for reading this issue.

I'm currently working on a Django project and I want to use yapf for formatting.

However, as I am trying to use pyproject.toml for excluding files, it does not work.

[tool.yapfignore]
ignore_patterns = [
  '**/migrations]*.py',
  'manage.py',
  'venv/*',
]

On the other hand, what makes it interesting is that the command line behaves differently and successfully ignores the files I want.

yapf --recursive --exclude '**/migrations/*.py' --exclude 'manage.py' --exclude 'venv/*' .

I still cannot figure out what would be the problem with this discrepancy.

At the moment, a part my dependencies is like the following:

pylint==2.12.2
pylint-django==2.4.4
pylint-plugin-utils==0.6
yapf==0.31.0

and my current Python version is 3.9.9.

If there is any problem with the way I make this issue post, please don't hesitate to point it out!

Thank you in advance!

@UponTheSky
Copy link
Author

It still doesn't work, so I had a workaround, .yapfignore.

**/migrations/*.py
manage.py
venv/*

I have to admit that the project would be a bit more complex, but I think pyproject.toml is currently not working for excluding files and directories. Any suggestions?

@hirosassa
Copy link
Contributor

hirosassa commented Jan 8, 2022

Hi @UponTheSky
Related to #955 , I think yapf version is the problem.
Latest version (0.32.0) of yapf released 26 Dec (ref: https://pypi.org/project/yapf/#history , CHANGELOG entry ), before then the yapfignore feature is only on main branch of this repository.
Currently, in my local PC, yapf ignore feature correctly worked.
Please check.

@UponTheSky
Copy link
Author

@hirosassa
Thank you for your reply! I appreciate your kindness.

Oh, I have missed the issue #955
I have checked and now it worked.

Now this issue is resolved so I close it.

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