Skip to content

Conversation

@Matistjati
Copy link
Contributor

@Matistjati Matistjati commented Dec 6, 2025

For each directory in submissions:

  • If it exactly matches some directory from the current problem version, do nothing
  • Otherwise, if it almost matches, warn for a potential typo
  • Otherwise, check if it matches some other directory from another format version

Sample output:

WARNING Potential typo: directory submissions/partially_acceptedd is similar to partially_accepted
WARNING Directory submissions/brute_force is not part of format version legacy, but part of 2023-07-draft

The magic value 0.75 was chosen quite arbitrarily.

>>> SequenceMatcher(None, 'wrong-answer', 'wrong_answer').ratio()
0.9166666666666666
>>> SequenceMatcher(None, 'wrong-answER', 'wrong_answer').ratio()
0.75
>>> SequenceMatcher(None, 'partially_ac', 'partially_accepted').ratio()
0.8
>>> SequenceMatcher(None, 'acc', 'accepted').ratio()
0.5454545454545454
>>> SequenceMatcher(None, 'Accecpted', 'accepted').ratio()
0.8235294117647058

@Matistjati
Copy link
Contributor Author

Not fixing the codefactor error, the TODO is pretty much impossible to fix currently.

@gkreitz gkreitz merged commit 50d9b40 into Kattis:master Dec 11, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants