-
Notifications
You must be signed in to change notification settings - Fork 23
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
326 warn if problemtitle differs from problemsettingsnamelanguage #329
326 warn if problemtitle differs from problemsettingsnamelanguage #329
Conversation
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.
mostly lgtm. Just 2 tiny things.
And indeed, would be nice if you could fix the empty problem.en.tex
in tests/
so that tests pass again.
I’ve now implemented the substring matching; looks like this: texname_letters = iter(texname)
if not all(c in texname_letters for c in yamlname):
warn(f'Problem titles in problem.{lang}.tex ({texname})' +
f' and problem.yaml ({yamlname}) differ;' +
r' consider using \problemname{\problemyamlname}.'
) Before I commit: Is this really what you want? It would accept \problemname{A Slightly Different Problem} when problem.yaml is problem: { en: A Different Problem } and similar situations, like https://open.kattis.com/problems/rationalsequence2 (which would not catch |
For us we pretty much always use We could also allow some way to disable the check, like |
Another idea is to disable the check as soon as |
Oh, I like that! Feel free to implement. |
Can someone grep |
For BAPC we have:
For NWERC we didn't deviate in the past 3 years. |
I did toy with the idea of removing matching Do note that 62a41b1 escalated |
Agreed.
👍 Thanks! Merging :) |
For #326, compare problemtitle in
problem.yaml
and various{lang}.tex
files.The extraction of
\problemname{foo}
inproblem.en.tex
is handled by a new method inbin/latex.py
. This is very bare-bones and would be confused by each of the following% \problenname{No warning produced, though outcommented}
\problemname{ foo }
Somebody should run this on a large repository of existing problems and see how many false positive warnings it generates.
It warns if no
problemname
is found in the tex source, which makes the BAPCtools testsuite unhappy. Maybe that warning shouldn’t be there. On the other hand, the specification actually requires it:https://github.com/Kattis/problem-package-format/blob/af5288b5c21d8a65ace08296ce7aecad8fdefdd2/spec/2023-07-draft.md?plain=1#L282
(and in the first line of the code!) so maybe it should be much stricter.