fix(src): resolve exclude paths#1034
Conversation
✅ Deploy Preview for djlint canceled.
|
|
The documentation seems to already be up-to-date with the behavior of this MR though: --exclude TEXT Override the default exclude paths.
--extend-exclude TEXT Add additional paths to the default exclude.Let me know what you think, I will be happy to adapt/refactor if needed. |
| exclude_paths = [] | ||
| for p in self.exclude.split("|"): | ||
| exclude_paths.append(Path(p.strip().replace("\\.", ".")).resolve()) | ||
| return exclude_paths |
There was a problem hiding this comment.
Not sure but maybe this could also just be a comprehension :)
| exclude_paths = [] | |
| for p in self.exclude.split("|"): | |
| exclude_paths.append(Path(p.strip().replace("\\.", ".")).resolve()) | |
| return exclude_paths | |
| return [Path(p.strip().replace("\\.", ".").resolve() for p in self.exclude.split("|")] |
There was a problem hiding this comment.
Or even better a for loop with yield (generator)
There was a problem hiding this comment.
I made another attempt and pushed 1ccc345
d85dbe2 to
1d29cf0
Compare
1d29cf0 to
aecb771
Compare
aecb771 to
871a75e
Compare
|
Thank you! |
|
Hi, I have reverted this PR as it is a breaking change and I think it should be reworked. The old behavior was more correct imo. |
|
Hi @monosans, sorry to read that.
Yes, I mentioned it in #1034 (comment).
I just saw #1047 and I might have overlooked some cases, sorry about that. But given that this exclude is a pretty standard option present in a lot of linters, I'm sure that this can be properly solved without too much hacking 😅
I tend disagree on this point. If This causes major problems for people in CI with GitLab for instance (our case). |
|
Whatever the solution ends up being here, it seems like it should probably use a new param name. Changing behavior for the existing param will cause issues for lots of users that have built workflows on the existing behavior. That's how I ended up here. |
Pull Request Check List
Resolves: #issue-number-here
Closes #1028
🛠️ with ❤️ by Siemens
/cc @nejch