-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
try to fix #1494 #1502
try to fix #1494 #1502
Conversation
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 3.28%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
good for review, it's done on my side. |
# [[File:...|...]] -> '' | ||
# except [[File:...|{{...}}]] that will end on '{{...}}' | ||
pattern = "|".join(iter(namespaces[locale])) | ||
text = sub(rf"\[\[(?:{pattern}):[^\{{]+?(?=\]\])\]\]*", "", text) |
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.
This is a ugly hack for "Annexe" and "Fichier". We want to keep namespaces using at least one template, like [[Annexe:blablabla|{{foo:|bar}}]]
but bot simple calls like [[Fichier:blablabla|foo|bar]]
.
It's fragile. If you can find another way, I'm open :)
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.
Maybe I found another way.
If we decided to parse those wikicode, and filter out later.
We really need to keep namespaces that doesn't end with a filename: we could do that check. If it seems to end with a file extension, then filter out. Else, keep the wikicode.
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.
We need to add more examples to be sure about a strategy.
Well, WDYT about merging that PR as-is? Let's see what breaks then, I'm not motivated to complexify more the code for that use case (not now at least). |
Sure, let's merge and see. |
Fixes #1494