-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix(src): resolve exclude paths #1034
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. |
djlint/settings.py
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even better a for loop with yield (generator)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
Pull Request Check List
Resolves: #issue-number-here
Closes #1028
🛠️ with ❤️ by Siemens
/cc @nejch