fix: ignore list not being used when passing files/directories as arguments#810
fix: ignore list not being used when passing files/directories as arguments#810Zamiell wants to merge 1 commit into
Conversation
|
But then other tools such as Ruff do override their |
|
@DimitriPapadopoulos Interesting, I didn't know that Ruff did that! For context, in my company we have the following linting algorithm:
Thus, the behavior in my pull request is preferable for this pattern. Because currently, when someone submits a pull request for a file on the ignore list, they erroneously get hit by yamllint errors! Ruff's behavior does make more sense for humans typing in the command manually. But with that said, I think the explicit warning that I put into this PR is a great middle ground that covers both sides! |
|
Ruff has |
Imagine that I put "1.yml" on the ignore list. Then, if I invoke yamllint like this:
Then, instead of linting 2-6, it will actually lint 1-6! Which seems almost certainly to be a bug, because other industry-standard tools such as Prettier will correctly skip 1.yml.
The behavior occurs with both files and directories. I didn't bother opening an issue in favor of just fixing the bug myself in a pull request.
One other situation that I thought about was when the user does not know that "1.yml" is on the ignore list and types
yamllint 1.yml, expecting it to find errors, but instead yamllint passes. This could lead the user to think that yamllint rules are turned off or yamllint is bugged in some way. To address this, I also decided to print a warning to standard error when this happens, to explicitly let the user know that the file is being skipped (as a quality of life feature). However, note that Prettier does not do this, so it might not be needed.